If Statement is Ignored?

UPDATE: Turns out I was trying to make a comparison between a DateTime object and the date() function of PHP. When I switched date() to DateTime the comparison was fine.

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