Hi! I'm running Windows 2000 with MS SQL Server Desktop Engine installed along with the client components from the full product. On this same computer I’m running my web server (IIS) and PHP.
I need to access MS SQL from PHP and this was working fine when I was running the SQL server on a Windows 2000 server machine. However, when I change the server name in my script I'm getting the PHP error: "Warning: mssql_connect(): Unable to connect to server: mike..."
I've tried every combination possible for the server name, including the machine name (mike), machine IP address, "localhost", "127.0.0.1", and combinations with the SQL port (I've verified that my SQL setup is listening on port 1433). What seems odd to me is that this was working perfectly when I was connecting to MSSQL on the server, but locally it's not working at all.
I know that there's not a problem with my SQL Server setup because I can use the database fine from both MSAccess and SQL Enterprise Manager. It's also not an authentication issue because my logon (SA) and password are correct, and I'm not getting an authentication error for that matter. Any clues as to what might be causing the problem?
Thanks! – Mike
I need to access MS SQL from PHP and this was working fine when I was running the SQL server on a Windows 2000 server machine. However, when I change the server name in my script I'm getting the PHP error: "Warning: mssql_connect(): Unable to connect to server: mike..."
I've tried every combination possible for the server name, including the machine name (mike), machine IP address, "localhost", "127.0.0.1", and combinations with the SQL port (I've verified that my SQL setup is listening on port 1433). What seems odd to me is that this was working perfectly when I was connecting to MSSQL on the server, but locally it's not working at all.
I know that there's not a problem with my SQL Server setup because I can use the database fine from both MSAccess and SQL Enterprise Manager. It's also not an authentication issue because my logon (SA) and password are correct, and I'm not getting an authentication error for that matter. Any clues as to what might be causing the problem?
Thanks! – Mike
Code:
//Connect string that worked to access the server:
$link = mssql_connect("server", "sa", "*****") or die("Could not connect");
//Connect string that isn't working locally:
$link = mssql_connect("mike", "sa", "*****") or die("Could not connect");