How many members have made comments approved for an article?

Your PHP is wrong but what you are doing looks like it should work.

$count = $wpdb->get_var(
    'SELECT COUNT(distinct comment_author) 
    FROM ' .$wpdb->comments. ' 
    WHERE comment_approved = 1 
    AND comment_post_ID = '.$post->ID
);
echo $count;  

Precisely, you were trying to use a variable inside single quotes, which doesn’t work. Variables don’t expand inside single quotes. And you did not have spaces in the string where they needed to be so you were generating invalid SQL. I don’t know where your $postid variable was coming from but inside a Loop $post->ID works so I used that.

There might be other ways to do it but I can’t tell unless you can add more context and detail to the question.

Here is a more elaborate example which includes several pieces of information that I think the OP might be asking for.

function get_commentCount_wpse_98315() { 
  global $wpdb; 
  $id = get_the_ID();
  $comment_data = $wpdb->get_row('
    SELECT 
    COUNT(distinct comment_author) as comment_count,
    COUNT(comment_ID) as comment_author_count,
    ("No idea what this is") as phrases
    FROM '.$wpdb->comments.'  WHERE comment_post_ID = '.$id
  ); 
//   var_dump($comment_data);
  echo implode(' | ',$comment_data);
}

tech