Jay Blanchard wrote:

[snip]
$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]); }
[/snip]

Why are you not using the single quoted array names? i.e.

@mysql_connect($cfg['hostname'],$cfg['username'],$cfg['password']);

Have you echo'd each out afterwords to see if they are right? Use
mysql_error() to return connection errors so that you know what they
are.
Yeah I have tried single quoted array names, double-quoted variable names, and the output of the print_r($cfg) displays the variables are present and when I do a mysql_error() and mysql_errno() I get could not connect to database, 1046 errors.

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



Reply via email to