I recently added a new table to my database and am getting the following error when I attempt a delete.
DELETE FROM usage WHERE date=’2011-07-26′;
ERROR 1064 (42000): 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 ‘usage where date=’2011-07-26” at line 1
EDIT: Turns out usage is a reserved word. See this link for reserved words:
http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
Try:
Escape your table names with a back tick (`) to avoid the clashing with reserved words.
USAGEis a reserved word in this case.