Home > Backend Development > PHP Tutorial > php连接sql2000

php连接sql2000

WBOY
Release: 2016-06-23 14:34:59
Original
1637 people have browsed it

先来复习一下怎么样用PHP自带的扩展php_mssql.dll连接SQL Server 2000,用mssql系列函数来操作,和操作MySQL的一样。

1、打开PHP配置文件php.ini,找到;extension=php_mssql.dll把前面的分号去掉。

2、找到mssql.secure_connection = Off修改成 mssql.secure_connection = On。

3、把PHP文件夹下的php_mssql.dll和ntwdblib.DLL这两个文件拷贝到C:\windows\system32\文件夹下。

4、重启Apache,OK

 

测试一下:

 

 

  {
  die('没连接上: ' . mysql_error());
  } mssql_select_db('test',$conn); //query语句 $Query="select * from news"; $AdminResult=mssql_query($Query); //输出结果 $Num=mssql_num_rows($AdminResult); for($i=0;$i"); } ?>

复制代码

 

当然还可以用pdo和ODBC来连接SQL Server。



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