Home > Backend Development > PHP Tutorial > PHP connection to SQLServer2005 method and code_PHP tutorial

PHP connection to SQLServer2005 method and code_PHP tutorial

WBOY
Release: 2016-07-13 17:18:50
Original
891 people have browsed it

1. Modify php.ini to delete and save the comment extension=php_mssql.dll.

Modify php.in to change mssql.secure_connection = Off to mssql.secure_connection = On.

PHP connection to SQLServer2005 method and code_PHP tutorial

2. Download ntwdblib.dll (2000.80.194.0) for 2005

Click to download

3. Open the file X:AppServphp5ext and copy 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.

PHP connection to SQLServer2005 method and code_PHP tutorial

Restart apache service

Connect to MS SQL Server 2005 code

Copy code The code is as follows:

$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("
");
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/621649.htmlTechArticle1. Modify php.ini to delete and save the comment extension=php_mssql.dll. Modify php.in to change mssql.secure_connection = Off to mssql.secure_connection = On. 2. Download ntwdblib.d of 2005...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template