small problem with select query
-
Below is a simple custom select query of wp_comments. $myposts is actually an array of post ids, but it is not working. Works fine with a single post id though.
$wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 1 AND user_id = $user AND comment_post_id = $myposts");
My question is how do I get this to count just the comments from a specific user of only the post_id’s in the array $myposts?
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘small problem with select query’ is closed to new replies.