kts Posted March 30, 2010 Share Posted March 30, 2010 Hey guys, It's been a while since I've php'd and MySQL'd but this should definitely be working... Not sure at all whats causing this problem.. Possibly a mysql table setting? $sql = "INSERT INTO lct (id, show, img) VALUES (NULL, '209', 'ba-nlns-logo.jpg');" 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 'show, img) VALUES (NULL, '209', 'ba-nlns-logo.jpg')' at line 1 Table structure is just id INT(30) primary key, show INT(30), img TEXT Even when I Insert via phpMyAdmin and then do create php code for it, paste it into SQL for phpMyAdmin I get the same error! It's crazy? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/ Share on other sites More sharing options...
cunoodle2 Posted March 30, 2010 Share Posted March 30, 2010 Try this.. <?php $sql = "INSERT INTO lct (show, img) VALUES ('209', 'ba-nlns-logo.jpg');" ?> And/OR this.. <?php $sql = "INSERT INTO lct (show, img) VALUES (209, 'ba-nlns-logo.jpg');" ?> Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034350 Share on other sites More sharing options...
kts Posted March 30, 2010 Author Share Posted March 30, 2010 Same issue occurs... INSERT INTO lct (show, img) VALUES ('209', 'ba-nlns-logo.jpg'); 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 'show, img) VALUES ('209', 'ba-nlns-logo.jpg')' at line 1 Could it be something set on the table? I mean I've NEVER had this much of an issue... it has to be something stupid. Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034355 Share on other sites More sharing options...
cunoodle2 Posted March 30, 2010 Share Posted March 30, 2010 See my other note in my previous post. I think it is the quotes around the integer Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034358 Share on other sites More sharing options...
kts Posted March 30, 2010 Author Share Posted March 30, 2010 I thought I had pasted both in sorry... Still: INSERT INTO lct (show, img) VALUES (208, 'clt-nlns-logo.jpg'); 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 'show, img) VALUES (208, 'clt-nlns-logo.jpg')' at line 1 It is making no sense to me what soever Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034360 Share on other sites More sharing options...
greatstar00 Posted March 30, 2010 Share Posted March 30, 2010 show is mysql reserve word add ` ` (left of 1, top of tab) around show Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034366 Share on other sites More sharing options...
kts Posted March 30, 2010 Author Share Posted March 30, 2010 Thank you much! Forgot about show... ugh thanks much. Quote Link to comment https://forums.phpfreaks.com/topic/197033-simple-mysql-insert-into-driving-me-nuts/#findComment-1034367 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.