wpdb-> not adding prefix to custom table

$wpdb->tablename works only with the tables initially present in a WordPress installation. These tables are defined in wp-includes/wp-db.php.

The second method you used is perfectly acceptable.

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