First:
I am using centos 4.2, same problem occurs for me on fedora FC4, FC2, and
also MACOSX.
mysql version 4.1.12
php 4.3.9
apache 2.0.52
above configuration is for centos 4.2 just built it.
here is the code:
$db_host = "localhost";
$db_user = "test";
$db_pass = "";
$db_db = "test";
$dbh = mysql_connect($db_host,$db_user,$db_pass) ||
die ("Unable to Connect to Database Server ->".mysql_errno().":"
.mysql_error());
echo $dbh;
$dbh = mysql_select_db($db_db,$dbh) ||
die ("Unable to Select Database->".mysql_errno().":" .mysql_error());
mysql_close() || die ("Unable to Close->".mysql_errno().":"
.mysql_error());
output that I get is:
1Unable to Select Database->0:
i can connect to mysql using cli
mysql -u test
output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
I checked the error_log and the output is:
[client 127.0.0.1] PHP Warning: mysql_select_db(): supplied argument is
not a valid MySQL-Link resource in
/home/nbhanji/Sites/Library/functions.php on line 10
I have been searching for last few days for anything that can help and I
cant get anywhere. Please HELP !!!!!!!!!!!!!!!!
Thanks in advance
Nick Bhanji