This question is an exact duplicate of:
I am working on a website that uses a previously developed image slider plugin. I had it all working in my local environment but once I took it live it kicked the following error anywhere the image slider is located...
Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/r/o/b/robertrhuspeak/html/desarch/wp content/plugins/portfolio/fields.php on line 48 and defined in /home/content/r/o/b/robertrhuspeak/html/desarch/wp-includes/wp-db.php on line 1246
The line of code it is referencing looks like this...
$fields = $wpdb->get_results($wpdb->prepare("SELECT meta_key, meta_value, meta_order IS NULL AS isnull FROM $wpdb->postmeta WHERE post_id=$postID ORDER BY isnull ASC, ABS(meta_order) ASC, meta_id"));
My understanding is that wp-db.php is expecting two arguments and the above code is not written with two arguments.
BUT, I frankly have no idea how it should be written. And I have dug hard on the Internet to find something that will explain it to me clearly.
Any guidance would be greatly appreciated.