PHP's own extended Php_mssql.dll connects SQL Server 2000, operates with the MSSQL series functions, and operates as MySQL.
1, open the PHP configuration file php.ini, find; Extension=php_mssql.dll remove the semicolon from the front.
2, find mssql.secure_connection = off modified into mssql.secure_connection = on.
3, the PHP folder under the Php_mssql.dll and Ntwdblib.DLL these two files copied to the C:windowssystem32 folder.
4, restart Apache,ok
*/
With Mssql_connect
code is as follows |
copy code |
$conn =mssql_ Connect (' localhost ', ' Pandao ', ' 1987 ') or Die (' 111cn.net database Not connected '); mssql_select_db (' Test ', $conn); //query statement $Query = "SELECT * from News"; $AdminResult =mssql_query ($Query); //Output $Num =mssql_num_ Rows ($AdminResult); for ($i =0; $i < $Num; $i + +) { $Row =mssql_fetch_array ($AdminResult); Echo ($Row [1]); Echo ("<br/ > "); } |