dudejma Posted July 31, 2011 Share Posted July 31, 2011 I keep getting 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 '@aol.com, 4569292450bf28d778d3db76533f72b2, 2, 1, 4, 1997, 1081526, 0, 0, 0, 201' at line 1 Here's the code corresponding to this: $sql = "INSERT INTO users (fname, lname, email, password, hub, birthMonth, birthDay, birthYear, vatsimID, transferHours, transferLink, oldPilotID, joinDate) VALUES ($fname, $lname, $email, $password1, $hub, $dobm, $dobd, $doby, $vatsim, $transferHours, $transferLink, $oldPID, $date)"; $result = mysql_query($sql) or die ("An error has occured. Please contact the webmaster with the following error: " . mysql_error()); I've tried EVERYTHING, what am I missing?! Maybe I just need a break. XD Thanks guys! Link to comment https://forums.phpfreaks.com/topic/243341-i-cant-find-the-problem-insert-query/ Share on other sites More sharing options...
dudejma Posted July 31, 2011 Author Share Posted July 31, 2011 Wow, I didn't know you had to have 's around the values. Woops. I always forget about those. Link to comment https://forums.phpfreaks.com/topic/243341-i-cant-find-the-problem-insert-query/#findComment-1249630 Share on other sites More sharing options...
PFMaBiSmAd Posted July 31, 2011 Share Posted July 31, 2011 String data values must be enclosed by single-quotes within the query. You should also store the date of birth information in a single mysql DATE data type field - YYYY-MM-DD Link to comment https://forums.phpfreaks.com/topic/243341-i-cant-find-the-problem-insert-query/#findComment-1249631 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.