$link = mysql_connect('localhost','xxx_xxx','xxxx')or die("Cannot connect to server. Sorry.");
mysql_select_db('xxxx_xxxx_xxxx', $link)or die("Sorry, database is not reachable");
use the above code for connect hopefully it will be connected with the $link.
i think you have missed the link...