Reputation: 3782
I created a table entries
with UNIQUE KEY title
. Now I want to execute the query INSERT ... ON DUPLICATE KEY UPDATE
, but I get compilation errors in phpMyAdmin:
Query:
INSERT INTO `entriess` (`title`, `description`)
VALUES ("TEST", "TEST")
ON DUPLICATE KEY UPDATE `title`=`AAA`
What am I doing wrong?
Upvotes: 0
Views: 799
Reputation: 76464
You have a syntax error. Change the query to
INSERT INTO `entriess` (`title`, `description`)
VALUES ('TEST', 'TEST')
ON DUPLICATE KEY UPDATE `title`='AAA'
In MySQL we enclose varchar
s into apostrophes, not into quotes.
Upvotes: 2