Catchable fatal error: Object of class stdClass could not be converted to string

You don’t specify where exactly the error comes from but I assume your problem is that you assign an object to the slug instead of a string.
your code should look like

$t = array_shift( $terms );
$params['slug'] = $t->slug;

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