dyluck Posted December 19, 2009 Share Posted December 19, 2009 Hi everyone, Does anyone know if this syntax is correct? $insert = "INSERT INTO product (TYPEID, SUBTID, SSTYPEID, PNAME, CATCHPHRASE, MAINKW, DESC, HEADER) VALUES ('$tid','$sid','$ssid','$product','$phrase,'$mkw','$desc','$link')"; mysql_query($insert) or die(mysql_error()); It keeps throwing this 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 'DESC, HEADER) VALUES ('Test Product','Test Phrase,'Test Title','The des' at line 1 Thanks for all your help! Quote Link to comment https://forums.phpfreaks.com/topic/185716-does-this-query-have-any-problems/ Share on other sites More sharing options...
Mchl Posted December 19, 2009 Share Posted December 19, 2009 If it keeps throwing error it means syntax is not correct. See here: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/185716-does-this-query-have-any-problems/#findComment-980636 Share on other sites More sharing options...
dyluck Posted December 20, 2009 Author Share Posted December 20, 2009 Thanks for your help. I narrowed it down and it is how I named one of the columns in the database "DESC" this is a mysql command. I just renamed the column and fixed a couple my pages. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/185716-does-this-query-have-any-problems/#findComment-980675 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.