Trouble running $wpdb->query() with last_insert_id

You can get the last inserted ID from $wpdb with the insert_id property:

$wpdb->insert( ... );
$couponId = $wpdb->insert_id

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