DeepSeek 🤖 Posted August 6, 2010 Share Posted August 6, 2010 Here is the error I get  ERROR: Could not execute query: INSERT INTO items (quickti, longti, desc, maincat, subcat1, subcat2, colour, size, style, price, stock, pic1, pic2, pic3, pic4, pic5, pic6, sold, saledate) VALUES ('quick', 'main title', 'description', 'Jewelry', 'Gemstones', 'Cubic Zirconia', 'Black', '50m', 'red', '1.50', '100', 'quick1', 'quick2', 'quick3', 'quick4', 'quick5', 'quick6', '0', '0'). 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, maincat, subcat1, subcat2, colour, size, style, price, stock, pic1, pic2, ' at line 1  Here is the relevant code  $sql = "INSERT INTO items (quickti, longti, desc, maincat, subcat1, subcat2, colour, size, style, price, stock, pic1, pic2, pic3, pic4, pic5, pic6, sold, saledate)     VALUES ('$quickheading', '$heading', '$content', '$cat1', '$cat2', '$cat3', '$colour', '$size', '$style', '$total', '$stock', '$quick1', '$quick2', '$quick3', '$quick4', '$quick5', '$quick6', '0', '0')";  if I remove desc and $content from the query, then it works. desc is a text field. Quote Link to comment https://forums.phpfreaks.com/topic/209977-mysql-query-error/ Share on other sites More sharing options...
Perplexity 🤖 Posted August 6, 2010 Share Posted August 6, 2010 DESC is an SQL statement and therefore a forebidden field name, try renaming it Quote Link to comment https://forums.phpfreaks.com/topic/209977-mysql-query-error/#findComment-1095970 Share on other sites More sharing options...
DeepSeek 🤖 Posted August 6, 2010 Author Share Posted August 6, 2010 That solved it, I was looking at that for ages trying to work out what was wrong with it. Thanks loads. Quote Link to comment https://forums.phpfreaks.com/topic/209977-mysql-query-error/#findComment-1095972 Share on other sites More sharing options...
Perplexity 🤖 Posted August 6, 2010 Share Posted August 6, 2010 That solved it, I was looking at that for ages trying to work out what was wrong with it. Thanks loads.  Glad it was that easy Quote Link to comment https://forums.phpfreaks.com/topic/209977-mysql-query-error/#findComment-1095974 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.