Open Side Menu Go to the Top
Register
mssql_connect() Unable to connect to server to Remote host from php hosting mssql_connect() Unable to connect to server to Remote host from php hosting

11-11-2016 , 04:17 AM
I have working mssql connecting codes and them working in my another company php host but dont work when i moved new host. All codes same i dont know why connect from new host ? In new host using cpanel and php ( asphostportal ) and im looking php.ini in cpanel mssql settings looking good. my codes below under.

Code:
$usernameb ="myuser";
$passwordb = "mypass";
$databaseb = "mydb";
$host ="myhostip"

$connection = mssql_connect($host, $usernameb, $passwordb);
if (!$connection) {  die('Not connected : ' . mssql_get_last_message());} 


$db_selected = mssql_select_db($databaseb, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mssql_get_last_message());
} else{


}
And gives that error on my new hosting

Warning: mssql_connect(): Unable to connect to server: ip here in

Any idea ?
mssql_connect() Unable to connect to server to Remote host from php hosting Quote
11-11-2016 , 05:06 AM
Some useful info in the comments at: http://php.net/manual/en/function.mssql-connect.php
mssql_connect() Unable to connect to server to Remote host from php hosting Quote
11-12-2016 , 12:00 AM
On the database machine check what IP's have permission to connect.
I'd bet the old host is listed but the new one is not
mssql_connect() Unable to connect to server to Remote host from php hosting Quote
11-13-2016 , 01:49 PM
From a DOS window try telnetting to the ip addr/port. Do you have access?
mssql_connect() Unable to connect to server to Remote host from php hosting Quote

      
m