Windows 2003 Standard Edition
IIS 6
SQL Server
I came into work yesterday to find that we were suddenly having a problem with our PHP scripts connecting to SQL SERVER. Many of these scripts have been in place and working fine for over a year. We found out that there were a few windows update patches that were installed over the weekend. We removed these patches, but we're still having the same problem. I was able to connect using ODBC without any problems, but not using the method below:
<?php
// phpinfo();
// exit();
$msconnect=mssql_connect("SERVER,1433","user","pass");
$msdb=mssql_select_db("DB",$msconnect);
$msquery = "select TITLE1 from VIEW_CLIENTS2";
$msresults= mssql_query($msquery);
while ($row = mssql_fetch_array($msresults)) {
echo "Row = " . print_r($row) . "<BR>";
}
?>
Here are the results:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: CMRSQL,1433 in D:\inetpub\wwwroot\testphp2.php on line 6
Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in D:\inetpub\wwwroot\testphp2.php on line 7
Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in D:\inetpub\wwwroot\testphp2.php on line 9
Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in D:\inetpub\wwwroot\testphp2.php on line 9
Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in D:\inetpub\wwwroot\testphp2.php on line 10
We have created a test server with the same environment and we're getting the exact same error.
Any ideas? Thanks for your help!