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 <

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 litera

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 ac

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 = > > $_SES

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 T

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

2002-03-05 Thread bvr
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]", $db); > > No need to quote the key name in a str