Home » Software Development

Auto Image Field wordpress plugin and $wpdb->prepare issue

27 November 2013 No Comment

I have been using Auto Image Field plugin by Arturo on this blog site. Lately when i added a blog post, the wp-admin shouted an exception:

Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/auto-image-field/auto-image-field.php on line 102.

To fix this issue, remove all instances of “$wpdb->prepare” as below:

Change the below line from
$fields = $wpdb->get_results($wpdb->prepare(“SELECT * FROM $field_table_name WHERE 1”), ARRAY_A);
$fields = $wpdb->get_results(“SELECT * FROM $field_table_name WHERE 1”, ARRAY_A);

This shall fix the issue.

You can also download the updated auto-image-field.php file.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image