I'm getting the following MySQL 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 'SET type = 'movie', SET category = 'New', SET music = 'Pop', SET' at line 1
Heres my query:
UPDATE music_content
SET title = 'Classic',
SET type = 'movie',
SET category = 'New',
SET music = 'Pop',
SET audience = 'Everyone'
WHERE id = '6'
Not sure what I'm doing wrong? - all the columns and tables exist and all the data is escaped (using mysql_real_escape_string()). Furthermore I have a valid/connected MySQL connection.
MySQL Version: 5.1.41.
The UPDATE syntax uses only one SET
even when multiple columns are being updated.
So try:
UPDATE music_content
SET title = 'Classic',
type = 'movie',
category = 'New',
music = 'Pop',
audience = 'Everyone'
WHERE id = '6'
You only need to have "SET" once:
UPDATE music_content SET title = 'Classic', type = 'movie', category = 'New', music = 'Pop', audience = 'Everyone' WHERE id = '6'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With