1. Modify the php.ini to remove Extension=php_mssql.dll annotations from the save.
Modify Php.in to change mssql.secure_connection = off to Mssql.secure_connection = on.
2. Download Connection 2005 Ntwdblib.dll (2000.80.194.0)
Click to download
3. Open the file X:\AppServ\php5\ext and copy the Php_mssql.dll to the System32 directory.
Copy the downloaded Ntwdblib.dll to the system32 directory.
Copy the downloaded Ntwdblib.dll to the PHP5 directory.
Restart the Apache service
Connecting MS SQL Server 2005 code
Copy Code code as follows:
<?php
$conn =mssql_connect (' 59.173.xxxxxx.xxxxxx,1468 ', ' sa ', ' xxxxxx ');
mssql_select_db (' HR ', $conn);
$Query = "SELECT * from Class";
$Result =mssql_query ($Query);
$Number =mssql_num_rows ($Result);
for ($i =0; $i < $Number; $i + +)
{
$Row =mssql_fetch_array ($Result);
Echo ($Row [1]);
Echo ("<br/>");
}
?>