“Warning: Missing argument 2 for wpdb::prepare()”
How do I fix it?
If you are seeing an error after upgrading to WordPress 3.5 that says something like this, you need to upgrade your theme.
We have fixed this with all of our themes and they are ready to download and re-install from your account page.
What if I have customized my theme’s code and don’t want to upgrade?
For those of you who have customized your theme’s code and don’t want to do a full upgrade, you’ll need to take a look at the warning message.
Here’s a sample error we have fixed from the Biznify Theme:
Warning: Missing argument 2 for wpdb::prepare(), called in /home/mintthem/public_html/demo/wp-content/themes/Biznify/products-pagetemplate.php on line 39 and defined in /home/mintthem/public_html/demo/wp-includes/wp-db.php on line 990
Step 1: Open the file it tells you to open. In this case, it is products-pagetemplate.php and Go to the line it refers to. In this case it is line 39
Step 2: Find the code that looks like this: $wpdb->prepare(“SELECT price FROM $table_name WHERE item_number = ‘$item_number’;”)
Step 3: Replace $item_number with %d
Step 4: Add $item_number after the last quotation mark. Also, make sure to put a comma before it. (notice the comma before $item_number below)
Example: $wpdb->prepare(“SELECT price FROM $table_name WHERE item_number = ‘%d‘;”, $item_number)
1More
Turn Visitors Into Paying Customers With WP Subscribe Pro WordPress Plugin - 1 views
1More
The 7 Best WordPress Analytics Plugins for Stat Junkies | Elegant Themes Blog - 0 views
1More
Why use File Manager Plugin for Wordpress? - WP File Manager - 0 views
1More
WordPress › WP Install Profiles « WordPress Plugins - 1 views
1More
WP Daily Themes Weekly WordPress Roundup #47 - 0 views
1More
WP Daily Themes Weekly WordPress Roundup #48 - 1 views
1More
WP Daily Themes Weekly WordPress Roundup #43 - 0 views
1More
WP Daily Themes Weekly WordPress Roundup #44 - 0 views
« First
‹ Previous
41 - 60 of 484
Next ›
Last »
Showing 20▼ items per page