vidus Posted February 7, 2012 Share Posted February 7, 2012 Hello everyone. I have no idea why this insert command will not work. I have never had this problem before. I have been staring at it for a while now. I just do. not. get. it. Im hoping that im not going insane, and just missed something really stupid... The error: 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 'Long, Details) VALUES ('3','49.15732','-123.126751','Test spot')' at line 1 The command: $sql="INSERT INTO spots (Member, Lat, Long, Details) VALUES ('3','49.15732','-123.126751','Test spot')"; if (!mysql_query($sql,$dbhandle)) { die('Error: ' . mysql_error()); } echo header("Location: ../map.php"); Link to comment https://forums.phpfreaks.com/topic/256578-pulling-my-hair-out-insert-will-not-work/ Share on other sites More sharing options...
Pikachu2000 Posted February 7, 2012 Share Posted February 7, 2012 LONG is a MySQL reserved word. http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Link to comment https://forums.phpfreaks.com/topic/256578-pulling-my-hair-out-insert-will-not-work/#findComment-1315335 Share on other sites More sharing options...
vidus Posted February 7, 2012 Author Share Posted February 7, 2012 LONG is a MySQL reserved word. http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Damnit. I should have checked that. I need more sleep. Thanks Pikachu2000... Link to comment https://forums.phpfreaks.com/topic/256578-pulling-my-hair-out-insert-will-not-work/#findComment-1315339 Share on other sites More sharing options...
fenway Posted February 7, 2012 Share Posted February 7, 2012 In general, don't use abbreviations. Link to comment https://forums.phpfreaks.com/topic/256578-pulling-my-hair-out-insert-will-not-work/#findComment-1315469 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.