if/Else have_posts Else fails to echo message to page

Try $loop->have_posts() on if statement. See if it fixes the issue.

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