Count post meta entries

WP_Query has a property that returns the no of posts that match your query.

You can print it as follow in your first try:

$query = new WP_Query( $args );

echo $query->post_count;

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