954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Parse error: syntax error, unexpected T_STRING in E:\Program Files\wamp\www\practice\

hi, i keep getting this error and i just cant figure out what is wrong. i got this code off a book that uses php v 5.1.4 and my wamp server runs php v 5.2.5, could this be a problem? does anybody know where i could download a good free php texteditor/compiler?
here is the code, line 89 is marked in red..

if($_POST[fax_number] ) {
	$add_fax_sql = "INSERT INTO fax ("master_id", "date_added", "date_modified", "fax_number", "type") VALUES ('".$master_id."', now(), now(), '".$_POST["fax_number"]."','".$_POST["fax_type"]."')";
	$add_fax_res = mysql_query($mysql, $add_fax_sql)
		or die(mysql_error());
}
cali_dotcom
Junior Poster in Training
53 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 
[color="Red"]$add_fax_sql


i dont think this is valid. is it?

upstream
Light Poster
43 posts since Sep 2007
Reputation Points: 10
Solved Threads: 1
 
i dont think this is valid. is it?

no, i tried to highlight the line with the problem with the message text editor but it didn't work. thats why there is the color tags in there

cali_dotcom
Junior Poster in Training
53 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

You used double quotes for the statement, but used them within, too.

so change your line 89 to this

$add_fax_sql = "INSERT INTO fax (`master_id`, `date_added`, `date_modified`, `fax_number`, `type`) VALUES ('".$master_id."', now(), now(), '".$_POST["fax_number"]."','".$_POST["fax_type"]."')";


it now should work.

Sam

helraizer
Light Poster
48 posts since Apr 2008
Reputation Points: 11
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You