Problem in inserting row to custom database table

The simplest thing to do here is remove the:

'id' => "",

from the data array.

Also, to simplify your database creation, you don’t need to do your get_var(), you can just change your SQL command to:

CREATE TABLE IF NOT EXISTS $table_name

This way you let the db handle creation of the table without the need of an extra SQL statement before hand.

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