Sql query returns empty. But not

If you can answer ‘yes’ to the questions in Emetrop’s comment, then try:

$sql = $wpdb->get_results('SELECT * from table1 WHERE id = $bransId');

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