Posted by Kimmo Laine on 06/17/05 06:59
"toedipper" <send_rubbish_here734@hotmail.com> kirjoitti
viestissδ:3Gnse.18341$K5.6706@newsfe4-win.ntli.net...
> Hello,
>
> Is this the right syntax for assigning a sql selct to a variable. When I
> use this I get a parse error on the line that this is on.
>
> $thecustid = 'SELECT custid FROM customers WHERE userid =
> $_SESSION['MM_Username']';
Using single qoutes in this case is wrong because a) you've got single
qoutes inside single qoutes, and that my freind, makes php go apeshit. b) it
doesn't interpret variables inside a string if the string is delimited by
single qoutes.
Throw in some double qoutes:
$thecustid = "SELECT custid FROM customers WHERE userid =
$_SESSION['MM_Username']";
And that should work.
--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears
eternal.erectionN0@5P4Mgmail.com
[Back to original message]
|