Tuesday, 13 August 2013

INSERT with on duplicate key update

INSERT with on duplicate key update

I'm having difficulty understanding the correct syntax for an insert with
an on duplicate key update check.
I currently get an error with the query:
INSERT INTO users_items (q,id,uid)
ON DUPLICATE KEY UPDATE
q = q + ?, id = ?, uid = ?
The unique key is uid + id together.
My error is:
Syntax error or access violation: 1064 You have an error in your SQL syntax;

No comments:

Post a Comment