Hi All,
I need a support in resolving mu query issue, I am pasting my query here,
$users2 = $wpdb->get_var($wpdb->prepare('SELECT COUNT(posts.ID) FROM wp_posts posts, wp_users user WHERE user.ID = posts.post_author AND posts.post_date_gmt >= DATE_SUB(NOW(),INTERVAL 180 DAY) AND user.ID = '.$user1->ID.' GROUP BY posts.post_author'));
When I print the query in user side it loads the user id and I copy paste that query in phpmyadmin and that pulls the result. But in code it is returning null result.
I am trying to get count of posts for each users who had made a post in last 6 months. Please help to resolve this.
Thanks
Sobin Babu