|
Posted by Dan on 06/19/05 00:58
So to follow up to this, your query should read:
"SELECT custid FROM customers WHERE userid = '$_SESSION[MM_Username]'";
The answer posted earlier is correct, I'm just spelling it out for you :)
If the session variable is giving you problems, redefine it before the SQL
statement like this:
$username = $_SESSION['MM_Username'];
"SELECT custid FROM customers WHERE userid = '$username'";
Also, in regards to putting the values in single quotes remember, that is
only for strings. If you are adding an integer to an INT field, you will
want to leave the single quotes off of the value.
Hope this helps and sorry if I stepped on the toes of others that replied.
"toedipper" <send_rubbish_here734@hotmail.com> wrote in message
news:tFnse.18340$K5.3925@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']';
>
> Thanks,
>
>
> td.
Navigation:
[Reply to this message]
|