Get the category fields even if there is no post

You need to use wp_get_object_terms(). The function will get all the terms available in taxonomies based on the arguments supplied.

wp_get_object_terms( get_the_ID(), 'category', array( 'fields' => 'slug' ) );

For more info can be found in here

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