Re: Re: Value of $_* variables
| From: | James Taylor | Date: | Wed, 06 Mar 2002 02:12:50 +0000 |
| Subject: | Re: Re: Value of $_* variables | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-87403@lists.php.net to get a copy of this message | ||
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 <20020305195342.CF56B20D07F@shell.hatesville.com>,
>
> jtx@nestllc.com (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);