affluent980 Posted January 29, 2009 Share Posted January 29, 2009 $result = mysql_query("SELECT * FROM Leads WHERE CID='" . $session->username . "' AND LeadID='echo $_GET['leadid']';" ); It is giving me an error saying Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING Please help!!! Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/ Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 $result = mysql_query("SELECT * FROM Leads WHERE CID='" . $session->username . "' AND LeadID='".$_GET['leadid']."'"); Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750165 Share on other sites More sharing options...
landavia Posted January 29, 2009 Share Posted January 29, 2009 hmm... next time.. create like this <?php $sql="SELECT * FROM Leads WHERE CID='". $session->username . "' AND LeadID='". $_GET['leadid']. "';"; $result = mysql_query($sql ); ?> hmmm.. strange echo inside? Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750172 Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 hmm... next time.. create like this <?php $sql="SELECT * FROM Leads WHERE CID='". $session->username . "' AND LeadID='". $_GET['leadid']. "';"; $result = mysql_query($sql ); ?> hmmm.. strange echo inside? You wanna get rid of that extra semi-colon as well Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750175 Share on other sites More sharing options...
landavia Posted January 29, 2009 Share Posted January 29, 2009 nah.. i just remove that echo about the semicolon.. i'm not remove because he/she might not type 1 query but more.. and the semicolon are needed Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750183 Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 nah.. i just remove that echo about the semicolon.. i'm not remove because he/she might not type 1 query but more.. and the semicolon are needed Are you sure?? The query is executed on the next line! Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750185 Share on other sites More sharing options...
Philip Posted January 30, 2009 Share Posted January 30, 2009 nah.. i just remove that echo about the semicolon.. i'm not remove because he/she might not type 1 query but more.. and the semicolon are needed Are you sure?? The query is executed on the next line! The semicolon is OK, but not needed in this case. There are better ways (IMO) of running multiple queries, but this is getting offtopic. Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750471 Share on other sites More sharing options...
gevans Posted January 30, 2009 Share Posted January 30, 2009 I understand the syntax for running multiple queries. What I was saying, is seeing that the query is exectued on the line after it is defined it obviously isn't being used for a multiple query so that semi-colon is pointless. Unless he was thinking of re-using that same query and 'sticking' another one afterwards which would just be a bizare process. Quote Link to comment https://forums.phpfreaks.com/topic/143047-solved-solved-thanks-what-is-wrong-with-this-code/#findComment-750532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.