Re: Value of $_* variables

From: Date: Tue, 05 Mar 2002 19:47:26 +0000
Subject: Re: Value of $_* variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-87330@lists.php.net to get a copy of this message
> $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? I'm sure that either mysql_query("select user from users where id = " . $_SESSION['id'], $db); or mysql_query("select user from users where id = {$_SESSION['id']}", $db); will work. One thing to note in case you cut and pasted that first line above, you are missing one of your single quotes around id. That might be throwing you off as well. Chris

« previous php.general (#87330) next »