Jump to content


Photo

Mysql query


  • Please log in to reply
3 replies to this topic

#1 KDragon

KDragon
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 27 June 2006 - 02:26 AM

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?

#2 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 27 June 2006 - 02:43 AM

$result=mysql_query("INSERT INTO $tableName (confirm_code,email) VALUES($confirmCode,$_POST['client_email'])");
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#3 KDragon

KDragon
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 27 June 2006 - 04:03 AM

[!--quoteo(post=388328:date=Jun 26 2006, 10:43 PM:name=JohnnyK)--][div class=\'quotetop\']QUOTE(JohnnyK @ Jun 26 2006, 10:43 PM) View Post[/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

#4 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 27 June 2006 - 06:46 AM

My bad. Do something like this:
$a = $_POST['client_email'];
$result = mysql_query("INSERT INTO $tableName (confirm_code, email) VALUES($confirmCode, $a)");
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users