views:

28

answers:

1
+3  Q: 

SQL error #1064

Trying to enter a value into a mediumblob field in a mySQL table but I'm getting:

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 id = 40' at line 3

INSERT INTO 'Picture'
VALUES (efvr)
WHERE id = 40 

What's wrong with this statement, and how can it be fixed?

+4  A: 

You can't have a WHERE clause on an INSERT. If you're trying to change an existing row, you need to use an UPDATE instead.

Michael Madsen
+1 ... The OP should also wrap the `efvr` value into single quotes, and use backticks instead of quotes for identifiers (like table names).
Daniel Vassallo
@Daniel: Correct, that's also something you would need to do.
Michael Madsen