johnmo
johnmo

Reputation: 23

SQL error on insert

What is wrong with the following SQL statement?

INSERT INTO thread (deleted) 
VALUES ('2009-01-02 17:41:02') 
WHERE thread.id = 28

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 thread.id = 28' at line 3

EDIT: I'm such an Idiot... UPDATE!!!

Thank you.

Upvotes: 2

Views: 124

Answers (2)

Alexis Dufrenoy
Alexis Dufrenoy

Reputation: 11966

You can't put a where in an insert...values... statement. What are you trying to do?

Upvotes: 1

mechanical_meat
mechanical_meat

Reputation: 169494

http://dev.mysql.com/doc/refman/5.0/en/update.html

UPDATE thread 
   SET deleted = TIMESTAMP '2009-01-02 17:41:02'
 WHERE id = 28;

Upvotes: 6

Related Questions