I have 2 different sites located on server/hosting "A" which need to connect to a DB on hosting "B". Both hostings originally offer the "localhost" option. How can i access a DB on server B from sites on server A? $dbh=mysql_connect ("IP-of-server1:localhost?", "username", "password"); mysql_select_db ("databasename"); Can anyone give me an advice on what should be put instead of "localhost"? thanks.
$dbh=mysql_connect ("IP-of-server1", "username", "password"); or $dbh=mysql_connect ("Domain-name-of-server1", "username", "password"); I guess... Link : helpdesk.hostmonster.com/kb/index.php?x=&mod_id=2&id=291
Put the IP address or domain name instead of localhost. Insure that you allow host a to connect from host b using mysql permissions. Peace,