WordPress loop : how to exclude some posts with their status?

You have the line global $posts; which is probably pulling a globalised $posts variable defined somewhere else and thus overwriting the one you just made. Remove that line or change the variable name to something unique.

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