List author’s posts with SQL

Your table names are wrong. note in your first query the use of $wpdb->posts to reference the posts table.

however– this is a very simple query that can be done via the API rather than writing SQL queries from scratch. Use a new WP_Query instance instead.

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