I’m running this SQL query:
IF EXISTS (SELECT * FROM score WHERE username='ms')
UPDATE score SET score='30' WHERE username='ms'
ELSE
INSERT INTO score (username,score) VALUES ('ms','30')
but I keep getting this syntax error:
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
IF EXISTS (SELECT * FROM score WHERE username='ms') UPDATE score SET score='30'
at line 1
What am I doing wrong?