PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$myServer = "***.***.***.***, 1433";//I have also tried the same server without port
$myUser = "user";
$myPass = "pass";
//Connect
$s = mssql_connect($myServer, $myUser, $myPass) or die("Unable to connect to server: $myServer");
and I get:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: ***.***.***.***, 1433 in C:\www\mssql.php on line 10
Unable to connect to server: ***.***.***.***, 1433
.
Do you have any ideas why I get that warning and I can not connect to the server.
Guys, thank you for your replies. I am not sure whether the server is down because a friend of mine connects through MsSQL server running on his machine but if I try to do the same by using Php it is impossible for a connection to be initiated. I use the credentials that my friend uses for his server but I can not connect by using Php.
Can you connect to it through Enterprise Manager or some other client interface? Does your server have the necessary drivers to connect to MsSql database servers? Can you ping the IP address of the DB server?
Thank you guys, but I still can not connect to the server but by creating a simple ODBC connection I connect successfully so I suppose that there is nothing wrong with the server.
Do you have any suggestions?
BTW:I got the same output when I updated my query as you suggested.