Re: simple, but missing something?
| From: | Burhan Khalid | Date: | Sat, 27 Mar 2004 06:43:51 +0000 |
| Subject: | Re: simple, but missing something? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181608@lists.php.net to get a copy of this message | ||
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'] = "admin@server.com"; 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.