You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND event_code <> 'acd2777e5a547f1d0588651c6ec2d5f4' AND archive = '1' AND '2010' at line 1