Get the number of comments awaiting moderation

You need wp_count_comments().

$comments_count = wp_count_comments();
$comments_count->moderated; // (int) comments in moderation 

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