Cannot modify header information – headers already sent

You should use the template_redirect action instead of wp_loaded.
It’s a good practice add die(); after wp_redirect() to.

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