How to get the id from the custom category?

I fixed it by using the following code:

$current_term = $wp_query->get_queried_object();    
$termid = $current_term->term_id;

Works quite well

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