I just today upgraded the jMonkeyEngine site to WordPress 3.5 and noticed that one of our plugins was causing errors. The exact error looks like Missing argument 2 for wpdb::prepare(). Looking at the wp-db.php file that ships with WordPress 3.5, we can see that there is indeed a second argument and it is documented as an array for options:
@param array|mixed $args The array of variables to substitute into the query’s placeholders if being called like
{@link http://php.net/vsprintf vsprintf()}, or the first variable to substitute into the query’s placeholders if being called like {@link http://php.net/sprintf sprintf()}.
Cool, so let’s change the code that calls the prepare method to have an empty array as a second argument:
If your queries were previously working, they will indeed continue to wok with the addition of this simple fix (though you may want to investigate using the functionality provided by WP in this new functionality)
ur the fucking man
Sorry, but where do you make this change?
You make this change in the plugin that is throwing the error.
Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/wp-content/plugins/foo/bar.php on line 292 and defined in /var/www/wp-includes/wp-db.php on line 990Using this example, you would be making the change on line 292 in “/var/www/wp-content/plugins/foo/bar.php”
Thank you a lot for the information!