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

git-svn-id: https://develop.svn.wordpress.org/trunk@10730 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-03-06 04:27:51 +00:00
parent 52a4f412ba
commit 1fb1534e8f
11 changed files with 151 additions and 89 deletions
+1 -1
View File
@@ -2273,7 +2273,7 @@ class wp_xmlrpc_server extends IXR_Server {
if( is_array( $attachments ) ) {
foreach( $attachments as $file ) {
if( strpos( $post_content, $file->guid ) !== false ) {
$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $post_ID, $file->ID) );
$wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
}
}
}