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 Quote Link to comment 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. 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.