I have a form that sends a update sql piece of code to my database.
The database consists of 1 table, which has 6 columns. They are, key, download, link, version, name, fs_version.
I’ve got key setup as a primary entry and I my form updates all the fields except for the key field and name field. It cannot update the name field as it doesn’t have that information.
A generated SQL piece of code form the form looks like this:
UPDATE `mytable` SET `version`=2, `link`=44, `fs_version`=55,
`download`=66, WHERE `key` = 1;
But I always get the error
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 'WHERE `key` = 1' at line 1
What is it I can do to fix this issue?
It is an extra comma right before
WHERE, you don’t need it. So just remove and everything will be fine