This is driving me insane. I’m trying to INSERT a value into the following “stats” table:
_date spam1
-----------------
2011-06-13
using
INSERT INTO stats (spam1) VALUES (7) WHERE `_date` = '2011-06-13'
MySQL returns
#1064 - 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 'WHERE `_date` = '2011-06-13'' at line 1
I don’t understand. Removing the quotes around the date or the backticks around _date doesn’t help either. What am I doing wrong?
[EDIT]
Thanks – you all get an upvote 🙂 How stupid of me…of course I need an UPDATE instead of INSERT…time to take a break I guess 😛
You want an UPDATE not an INSERT, try: