Show count of all comments by meta_value from a users posts

Take a look at the arguments you’re passing to get_comments() and compare them to the documentation on the WordPress Codex.

Your example –

$args = array(
    'include'      => $postids,
    'meta_query' => array(
      array(
        'key'   => 'viewed_status',
        'value' => 'unseen'
      )
    ),      
    'count' => true
);

The codex example –

$defaults = array(
    'author_email' => '',
    'ID' => '',
    'karma' => '',
    'number' => '',
    'offset' => '',
    'orderby' => '',
    'order' => 'DESC',
    'parent' => '',
    'post_id' => '',
    'post_author' => '',
    'post_name' => '',
    'post_parent' => '',
    'post_status' => '',
    'post_type' => '',
    'status' => '',
    'type' => '',
    'user_id' => '',
    'search' => '',
    'count' => false
);
  1. You’re passing a multidimensional array when the docs clearly indicate a single dimensional array.
  2. You’re also passing an array of ‘Post IDs’ when the docs clearly indicate that an integer is expected.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)