lilwing Posted August 31, 2007 Share Posted August 31, 2007 This is the first time I have ever used the update query. I am not having any luck figuring it out. Please post if you find my mistake, Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [bleeped] on line 46 here is the location of the problem: $sql = "UPDATE $table SET pagecontent = $_POST['T'] WHERE id = $_POST['id2']"; Link to comment https://forums.phpfreaks.com/topic/67460-solved-parse-error-in-update-query/ Share on other sites More sharing options...
lemmin Posted August 31, 2007 Share Posted August 31, 2007 It is putting the apostraphes in there as literals. Use, $sql = "UPDATE $table SET pagecontent = ".$_POST['T']." WHERE id = ".$_POST['id2']; Link to comment https://forums.phpfreaks.com/topic/67460-solved-parse-error-in-update-query/#findComment-338659 Share on other sites More sharing options...
sasa Posted August 31, 2007 Share Posted August 31, 2007 try echo $sql = "UPDATE $table SET pagecontent = '".$_POST['T']. "' WHERE id = ".$_POST['id2']; Link to comment https://forums.phpfreaks.com/topic/67460-solved-parse-error-in-update-query/#findComment-338663 Share on other sites More sharing options...
lilwing Posted August 31, 2007 Author Share Posted August 31, 2007 thanks guys, sasa, how come you used echo()? Link to comment https://forums.phpfreaks.com/topic/67460-solved-parse-error-in-update-query/#findComment-338686 Share on other sites More sharing options...
sasa Posted August 31, 2007 Share Posted August 31, 2007 just for debug Link to comment https://forums.phpfreaks.com/topic/67460-solved-parse-error-in-update-query/#findComment-338707 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.