How can I ask to an existing category?

If you want to check whether a certain post has a certain category, you need in_category, so your test would need to be:

if (in_category($category_name))

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