Numbering only parent comments

You can check if the comment has a parent and only count if not:

global $counter;
if ($comment->parent == 0){
  $counter++; 
}

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