Jas wrote:
Not sure why I am not able to get this to work, but to make my stuff
easier to configure for different environments I am trying to re-code
some of my stuff to work with options from an array.
$cfg['hostname'] = "www.server.com"; // Server domain or ip address
$cfg['username'] = "username"; // Database user name
$cfg['password'] = "password"; // Database password
$cfg['bugemail'] = "[EMAIL PROTECTED]";
The do something like this:
function database_connection() {
@mysql_connect($cfg[hostname],$cfg[username],$cfg[password]);
@mysql_select_database($cfg[database]); }
I think your array isn't in scope here, that's why you can't see the array.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php