How to display term in archive page?

Use wp_get_object_terms function to get any taxonomy you want, category, tag, state, etc.

For example:

$terms = wp_get_object_terms(get_the_ID(), 'state');
$state = array_pop($terms);
echo $state->name;

This function is returning array of terms, so in case you only have one state, it will return array of one item in it.

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