jrws Posted March 24, 2009 Share Posted March 24, 2009 Here's the mysql query: INSERT INTO forum_sub_cats(name,desc) VALUES('Random','Random Description') I have checked that everything exists, and those values are pseudo values mind you, however it spits 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) VALUES('Random','Random Description')' at line 1 So whats wrong with it? It will accept this one: INSERT INTO forum_sub_cats(name,admin)VALUES('$name','$admin') And for the life of me I can't find an answer.. Link to comment https://forums.phpfreaks.com/topic/150844-solved-just-a-really-quick-question-whats-wrong-with-the-insert/ Share on other sites More sharing options...
Mark Baker Posted March 24, 2009 Share Posted March 24, 2009 DESC - reserved word used in ORDER BY clauses Enclose it in backticks when using it as a table or column name Or better yet, change your column name Link to comment https://forums.phpfreaks.com/topic/150844-solved-just-a-really-quick-question-whats-wrong-with-the-insert/#findComment-792414 Share on other sites More sharing options...
jrws Posted March 24, 2009 Author Share Posted March 24, 2009 Thanks mate, I didn't realize. Link to comment https://forums.phpfreaks.com/topic/150844-solved-just-a-really-quick-question-whats-wrong-with-the-insert/#findComment-792417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.