Passing a variable to hyperlink text?

Sure, you only need to concatenate it again. Try:

echo '<a href="' . esc_url( $link ) . '">' . $link . '</a>';

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