Issue with php and sql
Posted: Sun Nov 15, 2009 3:07 pm
Hi, So i am creating a register form which has the fields login, pass and email. In my php, I connect to my database and extract the data and perform my query to insert the data into my database. I think this is the important part
When I test it out, I am getting the error on my webpage
Any help would be appreciated
cheers
Code: Select all
$_POST['login']=mysql_real_escape_string(strip_tags(trim($_POST['login'])));
$_POST['pass']=mysql_real_escape_string(strip_tags(trim($_POST['pass'])));
$_POST['email']=mysql_real_escape_string(strip_tags(trim($_POST['email'])));
mysql_query("INSERT INTO login SET login='{$_POST['login']}',pass='{$_POST['pass'],email='{$_POST['email']}'",$db);I know this is a simple error, but I am clueless and have no idea where or what to put in my statement. I added the email part of the statement myself, but all I thought I did was copy the pass one and then change the variables, so I dont know how I have muddled up the " etc.Parse error: syntax error, unexpected ',', expecting '}' in C:\xampplite\htdocs\register.php on line 22
Any help would be appreciated
cheers