Can anyone help me with this the bottom function is resulting in the error
Warning: Missing argument 2 for wpdb::prepare(), called in /home/.../wp-content/themes/theme/display.php on line 233 and defined in /home/.../wp-includes/wp-db.php on line 1147
This is the function
function ts_display_getnumposts($cat){
global $wpdb;
$qryString = "
SELECT Count(*) as totpost FROM ".$wpdb->posts." a
INNER JOIN ".$wpdb->term_relationships." b ON a.ID = b.object_id
INNER JOIN ".$wpdb->term_taxonomy." c ON b.term_taxonomy_id = c.term_taxonomy_id
INNER JOIN ".$wpdb->terms." d ON c.term_id = d.term_id
WHERE a.post_type = 'display'
";
if(strlen($cat)>0){
$qryString .= " AND d.slug = '".$cat."'";
}
$numposts = $wpdb->get_var($wpdb->prepare($qryString));
return $numposts;
}
Thank you for reading my question. And thanks in advance for your replies.
prepare()method. I too do not see a 2nd argument... - Madbreaks