mme Posted November 2, 2010 Share Posted November 2, 2010 Hi I am trying to update some values in the database however I keep getting syntax errors: mysql_query("UPDATE updates SET ('file' = 'new.exe2', 'filename' = 'new.exe2', 'serverfile' = 'http://static.php.net/www.php.net/images/php.gif', 'md5' = '97f3c717da19b4697ae9884e67aab123') WHERE 'updateid' = 10;") or die(mysql_error()); However I keep getting this 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 '('file' = 'new.exe2', 'filename' = 'new.exe2', 'serverfile' = 'http://static.php' at line 1 What is wrong with the code? Thanks, mme Quote Link to comment https://forums.phpfreaks.com/topic/217548-syntax-error-why/ Share on other sites More sharing options...
Pikachu2000 Posted November 2, 2010 Share Posted November 2, 2010 Don't quote table/field names in the query string. If you need to enclose them for a query with MySQL, use backticks instead. `table` `field` Quote Link to comment https://forums.phpfreaks.com/topic/217548-syntax-error-why/#findComment-1129459 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.