Yeah, the curly braces work great.  I was at first doing a 
"where id = " . $_SESSION['id'], $db);  but I like the curly braces better.

Oh, for those wondering, this wasn't a copy/paste, I just made this up as an 
example and forgot to put the second quote on $_SESSION['id']; twas a typo :)

On Tuesday 05 March 2002 06:04 pm, you wrote:
> In article <[EMAIL PROTECTED]>,
>
>  [EMAIL PROTECTED] (James Taylor) wrote:
> > $result = mysql_query("select user from users where id = $_SESSION['id]",
> > $db);
> >
> > That just doesn't work, so I have to first go:
> >
> > $sid = $_SESSION['id'];
> > $result = mysql_query("select user from users where id = $sid", $db);
> >
> > Anyway to get around this?
>
> Curly braces:
>
> $result = mysql_query("select user from users where id =
> {$_SESSION['id']}", $db);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to