Use wpdb::insert() and update(). see #6836

git-svn-id: https://develop.svn.wordpress.org/trunk@10731 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-03-06 05:06:15 +00:00
parent 1fb1534e8f
commit a5d73d7a2f
4 changed files with 12 additions and 32 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ case 'approvecomment' :
case 'editedcomment' :
$comment_id = absint( $_POST['comment_ID'] );
$comment_post_id = absint( $_POST['comment_post_id'] );
$comment_post_id = absint( $_POST['comment_post_ID'] );
check_admin_referer( 'update-comment_' . $comment_id );
+3 -3
View File
@@ -47,10 +47,10 @@ if ( $response['response']['code'] != 200 )
$body = str_replace(array("\r\n", "\r"), "\n", $response['body']);
$returns = explode("\n", $body);
foreach ($returns as $return) :
foreach ($returns as $return) {
$time = substr($return, 0, 19);
$uri = preg_replace('/(.*?) | (.*?)/', '$2', $return);
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time, $uri) );
endforeach;
$wdpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) );
}
?>