In WordPress 3.4.1: I am trying to add the Comment Author's total number of comments beside their info. (name + date/time) in the comment's list.
Here is the SQL that I am using:
$count = $wpdb->get_var('SELECT COUNT(comment_ID) FROM '. $wpdb->comments. ' WHERE comment_author_email = "' . get_comment_author_email() .'" ' AND comment_approved = '1' AND comment_type = '');
Basically The Author's email will be checked and the total number of comments will be displayed. But also I want only approved comments to be counted and also I don't want pingbacks/trackbacks to be counted. The above code is returning a syntax error and probably is wrong in terms of logic. Any help is appreciated. thanks.