search
Homephp教程php手册PHP连接SQLServer2005方法及代码

这篇文章主要介绍了PHP连接SQLServer2005方法及代码,有需要的朋友可以参考一下

1.修改php.ini将extension=php_mssql.dll的注释删除保存。

   修改php.in将mssql.secure_connection = Off改为mssql.secure_connection = On。

PHP连接SQLServer2005方法及代码

2.下载连接2005的 ntwdblib.dll (2000.80.194.0)

点击下载

3. 打开文件X:\AppServ\php5\ext ,,把php_mssql.dll 复制到system32目录下。

把下载的ntwdblib.dll 复制到system32目录下。

把下载的ntwdblib.dll 复制到php5目录下。

PHP连接SQLServer2005方法及代码

重启apache服务

连接MS SQL Server 2005代码

复制代码 代码如下:


 $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   {
 $Row=mssql_fetch_array($Result);
 echo($Row[1]);
 echo("
");
   }  
?>

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use