Issue with php and sql

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
nick2price
Forum Newbie
Posts: 18
Joined: Fri Nov 13, 2009 5:49 pm

Issue with php and sql

Post by nick2price »

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

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);
When I test it out, I am getting the error on my webpage
Parse error: syntax error, unexpected ',', expecting '}' in C:\xampplite\htdocs\register.php on line 22
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.

Any help would be appreciated

cheers
nick2price
Forum Newbie
Posts: 18
Joined: Fri Nov 13, 2009 5:49 pm

Re: Issue with php and sql

Post by nick2price »

No worries, sorted this issue out.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Glad you got it working. Please remember to post code questions in the PHP - Code section.
Post Reply