I am using two domain name ('domain1','domain2') and 2 server('server A' and 'server B'). 'domain1' is the Main domain. 'domain2', i am using as backend like, to store data. So the data will be stored in server B. When i use 'domain1' in browser it will display the data which is stored in 'server B' . I am not using 'server A' .
I have done some code. Please go through it and let me know what correction i have to do. The code is below,
//these hostname,dbname,user and password from server B,(is this correct?)
$hostname = "1.1.1.1" ;
$database = "db_B" ;
$user = "u_B" ;
$pasword = "u_pas" ;
$conn = mysqli_connect($hostname,$user,$pasword,$database) ;
if (!$conn)
{
die ("Error connecting to the database because : " .
mysqli_error($conn)) ;
}