Hi,
Usually my php script is hosted on a website that resides on the same server as my mysql database so I access my database with this kind of code:
$host = "localhost";
$user = "username";
$password = "thepassword";
$database = "db_name";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database.");
But what if my script needs to access a databases which is on a diiferent server ?
EG - during development of the script I want the script running on my website on my server, lets say "example.com" on IP 65.49.261.123
and I need it to access a corporate database run on a server in a different state, say IP 243.33.14.215
What do I need to make the connection - or does my script need to be on the same server ?
This is the first time I have needed to do this so I am not sure how to proceed :o
Thanks.
.