Re: [PHP] Re: Value of $_* variables

2002-03-06 Thread Erik Price
On Tuesday, March 5, 2002, at 09:12 PM, James Taylor wrote: Yeah, the curly braces work great. I was at first doing a where id = . $_SESSION['id'], $db); but I like the curly braces better. I like the curly braces too, but there's one time when they DON'T work: for ($i = 0; $i $n;

[PHP] Re: Value of $_* variables

2002-03-05 Thread Mike Eheler
$result = mysql_query(select user from users where id = $_SESSION[id], $db); No need to quote the key name in a string Mike James Taylor wrote: I'm sure this has been asked before, but at least not within the last 600 messages (i checked): I have the session variable $_SESSION['id'] set

Re: [PHP] Re: Value of $_* variables

2002-03-05 Thread bvr
Yes, there is, strings should *always* be quoted! See: http://wwwphpnet/manual/en/languagetypesarrayphp it's under do's and don'ts bvr Mike Eheler wrote: $result = mysql_query(select user from users where id = $_SESSION[id], $db); No need to quote the key name in a string --

[PHP] Re: Value of $_* variables

2002-03-05 Thread CC Zona
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,

Re: [PHP] Re: Value of $_* variables

2002-03-05 Thread James Taylor
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

Re: [PHP] Re: Value of $_* variables

2002-03-05 Thread Jason Wong
On Wednesday 06 March 2002 10:01, bvr wrote: Yes, there is, strings should *always* be quoted! See: http://www.php.net/manual/en/language.types.array.php it's under do's and don'ts .. bvr. Mike Eheler wrote: $result = mysql_query(select user from users where id = $_SESSION[id],

Re: [PHP] Re: Value of $_* variables

2002-03-05 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jason Wong) wrote: echo $doo[dah]; # is correct If constant 'dah' is defined, and its value is the name of the key you wish to access from array '$doo'. But if the string literall 'dah' is itself the name of the key you are trying to

Re: [PHP] Re: Value of $_* variables

2002-03-05 Thread Jason Wong
On Wednesday 06 March 2002 13:51, CC Zona wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jason Wong) wrote: echo $doo[dah]; # is correct If constant 'dah' is defined, and its value is the name of the key you wish to access from array '$doo'. But if the string literall 'dah' is