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 a.for_month>=03 and a.for_month<=12) or (a.for_year= and a.for_month<=02)) a' at line 1