php mysql database
Posted: Fri Jul 01, 2011 8:54 pm
hi, I'm trying to create registration forms, i wrote code and then run to test to make sure everything works fine but i'm getting errors that i can't figure out what did i missed to fix it.
the error said "Account CreatedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''users' , `status` , `first_question` , `first_answer` , `second_question` , `se' at line 1"
and my insert code is
$qry="INSERT INTO `tbld_all_register` ( `first_name` , `last_name` , `country` , `city` , `state` , `zipcode` , `username` , `email` , `password` , `birthday` , `birthmonth` , `birthyear` , `gender` ,'users' , `status` , `first_question` , `first_answer` , `second_question` , `second_answer` )VALUES ( '$first_name', '$last_name', '$country', '$city', '$state', '$zip_code', '$usrnam', '$email', '$member_password', '$b_day', '$b_month', '$b_year', '$gender', '".$_POST['username']."', '1' , '$email', '".$_POST['first_question']."' , '".$_POST['first_answer']."' , '".$_POST['second_question']."' , '".$_POST['second_answer']."')";
and the database list is
first_name , last_name , country, city, state, zipcode, username, email, password, birthday, birthmonth, birthyear, gender, users, status, first_question, first answer, second_question, second_ answer
i can't hardly figure out went wrong, please help thanks.
AM
the error said "Account CreatedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''users' , `status` , `first_question` , `first_answer` , `second_question` , `se' at line 1"
and my insert code is
$qry="INSERT INTO `tbld_all_register` ( `first_name` , `last_name` , `country` , `city` , `state` , `zipcode` , `username` , `email` , `password` , `birthday` , `birthmonth` , `birthyear` , `gender` ,'users' , `status` , `first_question` , `first_answer` , `second_question` , `second_answer` )VALUES ( '$first_name', '$last_name', '$country', '$city', '$state', '$zip_code', '$usrnam', '$email', '$member_password', '$b_day', '$b_month', '$b_year', '$gender', '".$_POST['username']."', '1' , '$email', '".$_POST['first_question']."' , '".$_POST['first_answer']."' , '".$_POST['second_question']."' , '".$_POST['second_answer']."')";
and the database list is
first_name , last_name , country, city, state, zipcode, username, email, password, birthday, birthmonth, birthyear, gender, users, status, first_question, first answer, second_question, second_ answer
i can't hardly figure out went wrong, please help thanks.
AM