My problem is thus...
Code: Select all
<?php
global $cfg;
print_r($cfg);
$dblink = @mysql_connect($cfg['dbhost'], $cfg['dbuser'], $cfg['dbpass'])
or die ("Could not connect to mySQL database. $cfg['dbuser']@$cfg['dbhost'] - ".mysql_error());
?>The mySQL error is correct, because I'm supplying the wrong password on purpose, and it works as expected when I put in the right password.Array
(
[dbuser] => intranet
[dbpass] => notreallythisbutitdlookstupidtohavethisblank
[dbhost] => localhost
)
<br />
<b>Notice</b>: Undefined index: 'dbuser' in <b>c:\intranet\dev\common.php</b> on line <b>25</b><br />
<br />
<b>Notice</b>: Undefined index: 'dbhost' in <b>c:\intranet\dev\common.php</b> on line <b>25</b><br />
Could not connect to mySQL database. @ - Access denied for user: 'intranet@127.0.0.1' (Using password: YES)
When I comment out the 'or die', it works perfectly. Is there a bug I should know about?