How to display the number of posts in a category using WP Query

You can use the found_posts property, which is the total number posts for the current query:

echo $the_query->found_posts;

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