stevesimo Posted March 22, 2007 Share Posted March 22, 2007 Hi, I am attempting to pull out a record where the ID of the order is equal to the value contained in a session variable called policyRef. I keep getting a parse error so am not sure what I am doing wrong. Here is the offending line of code: $certificate = mysql_query("SELECT * from orders where PolicyID=".$_SESSION['policyRef']""); Any help appreciated. Thanks, Steve (Blackpool) Link to comment https://forums.phpfreaks.com/topic/43845-solved-problem-using-session-variable-in-query-string/ Share on other sites More sharing options...
kenrbnsn Posted March 22, 2007 Share Posted March 22, 2007 You have too many quotes at the end of the string. You probably want: <?php $certificate = mysql_query("SELECT * from orders where PolicyID=".$_SESSION['policyRef']); ?> or <?php $certificate = mysql_query("SELECT * from orders where PolicyID='".$_SESSION['policyRef'] . "'"); ?> Ken Link to comment https://forums.phpfreaks.com/topic/43845-solved-problem-using-session-variable-in-query-string/#findComment-212855 Share on other sites More sharing options...
stevesimo Posted March 22, 2007 Author Share Posted March 22, 2007 Hi Ken, that code worked for me! thanks for your help m8. Steve (Blackpool) Link to comment https://forums.phpfreaks.com/topic/43845-solved-problem-using-session-variable-in-query-string/#findComment-212856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.