AStrangerWCandy Posted August 29, 2009 Share Posted August 29, 2009 Having the php program print out the mysql query it generates, and it looks fine. INSERT INTO users (user_Id, userName, pass, firstName, lastName, country) VALUES (id4a99b9563701d, abcd, abcd, abcd, abcd, United States) I cut and paste this line into phpmyadmin on the proper database and get #1064 - 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 'States)' at line 1 The columns match up perfectly in case and letters. All are VARCHAR 30 or higher Quote Link to comment Share on other sites More sharing options...
peranha Posted August 30, 2009 Share Posted August 30, 2009 INSERT INTO users ('user_Id', 'userName', 'pass', 'firstName', 'lastName', 'country') VALUES ('id4a99b9563701d', 'abcd', 'abcd', 'abcd', 'abcd', 'United States') try that, it is because of the Space between Unite and States. Quote Link to comment Share on other sites More sharing options...
AStrangerWCandy Posted August 30, 2009 Author Share Posted August 30, 2009 Thanks, what was it! However now that I removed the space I submit this: INSERT INTO users (user_Id, userName, pass, firstName, lastName, country) VALUES (id4a99b9563701d, abcd, abcd, abcd, abcd, UnitedStates) and its giving me an error stating #1054 - Unknown column 'id4a99b9563701d' in 'field list' Quote Link to comment Share on other sites More sharing options...
AStrangerWCandy Posted August 30, 2009 Author Share Posted August 30, 2009 nm, figured it out, thanks again! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 30, 2009 Share Posted August 30, 2009 String data must be enclosed in quotes to make them strings instead of being treated as keywords or column names and column names are not enclosed in quotes as that would make them strings. 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.