Heres how I always connect, yes ok you cant see which is wrong, user/pass or db connecting. But if the details are right and db is working it connects you. Thats the main thing right??
anyway try this:
$db = mysql_connect('host','user','pass');
mysql_select_db('db_name', $db) or die( "Unable to select database,
make sure it exists and that the username and password are
correct and then run this page again.");
I use this in a function but you could also assign all to a variable, in which case it would look like this:
$db = mysql_connect('host','user','pass');
$connect = mysql_select_db('db_name', $db) or die( "Unable to select database,
make sure it exists and that the username and password are
correct and then run this page again.");
then on the page you wish to connect you just type $connect;
or if you use a function : function_name();
Hope this helps
RT