how to count the current posts terms

wp_count_terms function counts terms in a given taxonomy (e.g. total number of categories, total number of tags).

To get what you want, get the terms for the post and just count them count( wp_get_post_terms( $post_id, $taxonomy, $args ) );. Or, assuming that in real life you might need those terms later:

$terms = wp_get_post_terms( $post_id, $taxonomy, $args );
$terms_count = count ( $terms );

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