Hi All,
I need to connect mysql database to a an external server. (i.e) for an example. I have hosted 2 different sites in two different servers. I have site A and site B. If I register a form in site B then the data's should be posted and stored to site A's database. And so for this I need to connect db of site A from site B. For this I used this below coding which runs in site B.
$host = "www.abc.net.in";
$root = "some_username";
$pswd = "some_password";
$dbnm = "my_database_name";
$DB_connect = mysql_connect($host, $root, $pswd);
if(!$DB_connect){
die('Error in Database connection');
}
mysql_select_db($dbnm, $DB_connect);
But this not works shows error. And also I heard we need to use port number of site A. And also I got the error. I dont no do I used wrong port number or some other things. Totally I am very much confused with this thing. Please give me a solution for this.