PHP connection SQLServer2005 method, phpsqlserver2005
1. Modify PHP.ini to save Extension=php_mssql.dll's comments .
Modify Php.in to change mssql.secure_connection = off to Mssql.secure_connection = on.
2. Download the 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 Apache Service
Connecting MS SQL Server 2005 code
Copy the 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 ("
");
}
?>
See, is not already connected on the sql2005, hope that small friends can like.
http://www.bkjia.com/PHPjc/948408.html www.bkjia.com true http://www.bkjia.com/PHPjc/948408.html techarticle PHP Connection SQLServer2005 method, phpsqlserver2005 1. Modify the php.ini to delete the Extension=php_mssql.dll comment. Modify Php.in to change mssql.secure_connection = off to Mssql.secure ...