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 m.data <= DATE_ADD(NOW(), INTERVAL 2 MONTH) AND m.data >= DATE_SUB(NOW(), ' at line 11