Query_posts works when appending via AJAX call wp_query doesn’t?

Calling the_post() operates on the global $wp_query, for your custom query you need to call the method of the query object: $loop->the_post().

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