Jump to content

[SOLVED] SOLVED! THANKS! What is wrong with this code?


affluent980

Recommended Posts

$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!!!

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 ;)

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.