nathanmaxsonadil Posted August 10, 2007 Share Posted August 10, 2007 Does anyone know what's the matter with this code? It gives me this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in my_dir/myfile.php on line 50 myfile.php 44 if (base64_decode($_GET['need']) != "" && $_GET['delete'] == "true") { 45 $query = "DELETE FROM thing WHERE need = '" . base64_decode($_GET['need']) . "'"; 46 mysql_query($query) or die(mysql_error()); 47 $query2 = "INSERT INTO thingpend (pend) 48 VALUES ('" . base64_decode($_GET['need']) . "\" . $session->userinfo['email'] . "')"; 49 mysql_query($query2) or die(mysql_error()); 50 echo "<div id='mes'><ul><li>Thanks</li></ul></div>"; } Link to comment https://forums.phpfreaks.com/topic/64339-solved-parse-error-syntax-error-unexpected-t_const/ Share on other sites More sharing options...
teng84 Posted August 10, 2007 Share Posted August 10, 2007 47 $query2 = "INSERT INTO thingpend (pend) VALUES ('" . base64_decode($_GET['need']) . "', ". $session->userinfo['email'] . "')"; you missed the " and also , Link to comment https://forums.phpfreaks.com/topic/64339-solved-parse-error-syntax-error-unexpected-t_const/#findComment-320808 Share on other sites More sharing options...
genericnumber1 Posted August 10, 2007 Share Posted August 10, 2007 the problem I see is on line 48 where you have "\".. it's escaping that quote even though you don't mean for it to be, changing it to "\\" should fix that Link to comment https://forums.phpfreaks.com/topic/64339-solved-parse-error-syntax-error-unexpected-t_const/#findComment-320811 Share on other sites More sharing options...
trq Posted August 11, 2007 Share Posted August 11, 2007 $query2 = "INSERT INTO thingpend (pend) VALUES ('" . base64_decode($_GET['need']) . "', '" . $session->userinfo['email'] . "')"; Link to comment https://forums.phpfreaks.com/topic/64339-solved-parse-error-syntax-error-unexpected-t_const/#findComment-320861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.