Mark Steudel wrote:
I was wondering what the general rule on using the global driective versus
passing in a variable by reference, why you should or shouldn't, etc.
e.g. function ()
{
    global $db;
$res =& $db->query( "SQL");
}
or function ( &$db )
{
$res =& $db->query( "SQL");
}


or

function foo ()
{
    $db = & $GLOBALS['database'];
    $res = & $db->query();
}

or

function foo ()
{
    $res = & $GLOBALS['database']->query();
}

Just some more possibilities...


cheers
Jens

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

Reply via email to