ok things that your are trying is: mysql database installed on one machine and want access from other machine .
$link=mysql_connect("Host on which your mysql is ", "usrname","passwd") or die("No host Connection !");
mysql_db("db on host you want to select ",$link) or die("No host DB Connection!");
this script will make connection to your remote mysql db now you can query ....