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]", $db);
>  >
>  > No need to quote the key name in a string.

What Mike meant was:


 echo "$doo[dah]"; # is correct
 echo $doo['dah']; # is correct
 echo "$doo['dah']; # is incorrect (and I think, produces a parse error)


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Philosophy:  A route of many roads leading from nowhere to nothing.
-- Ambrose Bierce
*/

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

Reply via email to