Tagged: budyblog
- I try this but no luck - $count = $wpdb->get_var( $wpdb->prepare( “SELECT count(‘*’) FROM {$wpdb->posts} WHERE post_author=%d AND (post_status=’publish’||post_status=’draft’||post_type =’Concours’)”, $user_id ) ); 
- Hi Richard, 
 What is the post type name. ‘Concours’ is the label of that post type( seems to me as WordPress recommends using lower cases for the name )- Also, If I understand it correctly, you want it for ‘post’ as well as ‘Concours’ both. Is that right? 
- Hello Brajesh, yes i want to have a total count of both posts and concours’posts from a user 
- Hi Richard, 
 Apologies for the delayed reply.
 here is the code- $count = $wpdb->get_var( $wpdb->prepare( "SELECT count('*') FROM {$wpdb->posts} WHERE post_author=%d AND ( post_type = 'post' || post_type ='concours' ) AND post_status='publish'", $user_id ) );- Hope that helps. 
You must be logged in to reply to this topic.
 This topic is: not resolved