Checking if a woocommerce attribute is set

Simply check this by using:

if ( $terms && ! is_wp_error( $terms ) ) {
    //your code
}

Take a look at the codex page for get_the_terms() for a deeper insight, especially the »Returns« and »Examples« section.

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