This page is a permanent link to the reply below and its nested replies. See all post replies »
Sharon · F
Most MySQL statements require a ; at the end. I'm guessing that initial ; is ending a previous statement. What is the full query you're trying to run?

SW-User

SW-User
Check pls @MartinTheFirst
Sharon · F
@SW-User
The UPDATE line needs to end with a ';'. The reason ;DELETE... works is because it treats that initial ';' as the end of the previous line.
Change it to -
UPDATE mytable SET username="myuser" WHERE id=8;
DELETE FROM mytable WHERE id=8;
Some statements will work without a ';' at the end but it's best to always use one anyway.
It's also a good idea to enclose table and field names in backticks to avoid conflict with keywords of the same name. e.g.
UPDATE `mytable` SET `username` = "myuser" WHERE `id` = 8;
DELETE FROM `mytable` WHERE `id` = 8;
UPDATE mytable SET username="myuser" WHERE id=8
DELETE FROM mytable WHERE id=8
DELETE FROM mytable WHERE id=8
The UPDATE line needs to end with a ';'. The reason ;DELETE... works is because it treats that initial ';' as the end of the previous line.
Change it to -
UPDATE mytable SET username="myuser" WHERE id=8;
DELETE FROM mytable WHERE id=8;
Some statements will work without a ';' at the end but it's best to always use one anyway.
It's also a good idea to enclose table and field names in backticks to avoid conflict with keywords of the same name. e.g.
UPDATE `mytable` SET `username` = "myuser" WHERE `id` = 8;
DELETE FROM `mytable` WHERE `id` = 8;