I have this dbinfo.ini file that can be read only by the administrator. It contains the password and username to access the database. When the server executes the following code it successfully gets the uername and password and successfully connects to the database. the problem is IT CANT SELECT A DATABASE? I have no idea why? Has anyone ever seen anything like this before? Any ideas? Thanks for the help in advance!
<?php
error_reporting(1);
$db = "leafandtree_net_-_leafandtree";
$dbcfg = parse_ini_file("dbinfo.ini");
$link = mysql_connect("localhost", $dbcfg['user'], $dbcfg['password'])
or die("Could not connect");
if($link) {
echo "connected <br/> \n";
echo "link = $link <br/> \n";
}
mysql_select_db($db)
or die ("Can't select db: $db <br/> \n" .
"FAILS HERE!!!");
mysql_close($link);
?>