sniped22 Posted August 30, 2007 Share Posted August 30, 2007 Why doesn't this work? $query = "insert into user ($email, $refid, $refby, $ppemail, $pass, $fname, $lname, $address, $city, $state, $zip, $country, $phone, $bdaymonth, $bdayday, $bdayyear, $prize)values (email, myrefid, refby, ppemail, pass, fname, lname, address, city, state, zip, country, phone, bdaymonth, bdayday, bdayyear, prize)"; the mysql error is: 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 '@yahoo.com, *****, ****, *****, r*****, *****, ****, *****, ' at line 1 Link to comment https://forums.phpfreaks.com/topic/67291-solved-insert/ Share on other sites More sharing options...
Jessica Posted August 30, 2007 Share Posted August 30, 2007 Well you have it backwards for one. It's: INSERT INTO table(columns here) VALUES(values here). Secondly, your values which are strings need to be quoted. USE: '$email' not $email. Link to comment https://forums.phpfreaks.com/topic/67291-solved-insert/#findComment-337592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.