KDragon Posted June 27, 2006 Share Posted June 27, 2006 I keep getting this error:Parse error: syntax error, unexpected T_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRINGwith 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? Link to comment https://forums.phpfreaks.com/topic/12980-mysql-query/ Share on other sites More sharing options...
johnnyk Posted June 27, 2006 Share Posted June 27, 2006 $result=mysql_query("INSERT INTO $tableName (confirm_code,email) VALUES($confirmCode,$_POST['client_email'])"); Link to comment https://forums.phpfreaks.com/topic/12980-mysql-query/#findComment-49917 Share on other sites More sharing options...
KDragon Posted June 27, 2006 Author Share Posted June 27, 2006 [!--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 Link to comment https://forums.phpfreaks.com/topic/12980-mysql-query/#findComment-49937 Share on other sites More sharing options...
johnnyk Posted June 27, 2006 Share Posted June 27, 2006 My bad. Do something like this:$a = $_POST['client_email'];$result = mysql_query("INSERT INTO $tableName (confirm_code, email) VALUES($confirmCode, $a)"); Link to comment https://forums.phpfreaks.com/topic/12980-mysql-query/#findComment-49976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.