Reputation: 815
IF (5>2) THEN
UPDATE people
set name = 'jacob';
END IF;
I am using phpmyadmin query A statement as simple as that does not execute because of an error. I tried inserting the same code between 'BEGIN AND END' and I get the same error message
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 (5 > 2) then
Upvotes: 0
Views: 346
Reputation:
There is no THEN in sql if statements. The following should work:
IF (5>2)
BEGIN
UPDATE people SET name = 'jacob';
END
Upvotes: 2