Jump to content

Archived

This topic is now archived and is closed to further replies.

KDragon

Mysql query

Recommended Posts

I keep getting this error:
Parse error: syntax error, unexpected T_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING

with this line of code:
$result=mysql_query("INSERT INTO $tableName(confirm_code,email)VALUES($confirmCode,$_POST[\"client_email\"]");

I have no idea why, can somebody help me out?

Share this post


Link to post
Share on other sites
$result=mysql_query("INSERT INTO $tableName (confirm_code,email) VALUES($confirmCode,$_POST['client_email'])");

Share this post


Link to post
Share on other sites
[!--quoteo(post=388328:date=Jun 26 2006, 10:43 PM:name=JohnnyK)--][div class=\'quotetop\']QUOTE(JohnnyK @ Jun 26 2006, 10:43 PM) [snapback]388328[/snapback][/div][div class=\'quotemain\'][!--quotec--]
$result=mysql_query("INSERT INTO $tableName (confirm_code,email) VALUES($confirmCode,$_POST['client_email'])");
[/quote]
that gives me a new error, same line:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

Share this post


Link to post
Share on other sites
My bad. Do something like this:
$a = $_POST['client_email'];
$result = mysql_query("INSERT INTO $tableName (confirm_code, email) VALUES($confirmCode, $a)");

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.