jryan54 Posted June 9, 2009 Share Posted June 9, 2009 hey guys! I'm getting a parse error when trying to execute the following insert query: $query = ("INSERT INTO dp_codes (id, 1) VALUES ('$id', '$code1')"); mysql_query($query) or die('Error, insert query failed'); Ive tried to work it many different ways around but for the life of me cant get it to work....any ideaS??? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 9, 2009 Share Posted June 9, 2009 I'm going to guess the error is with your column name. Try: $query = "INSERT INTO dp_codes (`id`, `1`) VALUES ('$id', '$code1')"; I think the problem is with the 1 as a column name. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted June 9, 2009 Share Posted June 9, 2009 Ive tried to work it many different ways around but for the life of me cant get it to work....any ideaS??? You could put in a call to mysql_error() and see what the actual error is; I mean, how do you expect to solve it if you don't know what the actual message is? Otherwise your question is like someone saying, "I'm having a problem with my car...any ideas???" More information is required! Quote Link to comment Share on other sites More sharing options...
jryan54 Posted June 9, 2009 Author Share Posted June 9, 2009 Thanks! You were right...it looks like it was the collumn names...they would not work with any numbers etc...changed from 1 to code1 and it worked first time! Thnanks Quote Link to comment 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.