Chinaunix首页 | 论坛 | 博客
  • 博客访问: 17912220
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-29 10:38:19

SQL Server 2005 php驱动是php5的一个扩展,它提供访问SQL Server 2005和SQL Server 2000.该扩展数据访问接口可以应用在所有版本(包括体验版)的SQL Server 2005和SQL Server 2000.该SQL Server 2005 php驱动支持Windows验证,参数绑定(译预处理),大对象流,原数据访问和错误处理.

php程序员站

在你使用IIS:Internet Information Services和FastCGI组件,该驱动拥有良好的性能和稳定的Windows平台.
关于FastCGI组件可访问:FastCGI for IIS.

访问http://blogs.msdn.com/sqlphp和SQL Server Data Access Forum寻求支持和提供反馈

php程序员之家

原文:

phperz~com

The SQL Server 2005 PHP Driver is a PHP 5 extension that provides data access to SQL Server 2005 and SQL Server 2000. The extension provides a procedural interface for accessing data in all versions (including Express) of SQL Server 2005 and SQL Server 2000. The SQL Server 2005 Driver for PHP API includes support for Windows Integrated Authentication, parameter binding, streaming of large objects, metadata access, and error handling.


The PHP Driver takes advantage of the improved performance and stability of PHP on the Windows platform when you are using Internet Information Services (IIS) and the FastCGI component. For more information about the FastCGI component, see FastCGI for IIS . phperz~com


The functionality described and demonstrated in this document is a subset of the functionality planned for the final version of the SQL Server 2005 Driver for PHP and is subject to change. To provide feedback or find support, visit http://blogs.msdn.com/sqlphp or SQL Server Data Access Forum.

配置: php程序员之家

1.将php_sqlsrv.dll 或 php_sqlsrv_ts.dll 放到PHP的扩展目录中(PHP\EXT).
2.编辑php.ini文件,添加以下扩展:
extension=php_sqlsrv.dll

extension=php_sqlsrv_ts.dll
3.重启服务器.

www~phperz~com

示例:

以下为引用的内容:
php
$dbbase='testlab';
$uid='sa';

php程序员站


$pwd='infobus';
$connectionInfo=array("Database"=>$dbbase,"UID"=>$uid,"PWD"=>$pwd);

php程序员站


$serverName="JUJUMAOEXPRESS";
if(!($conn=sqlsrv_connect($serverName,$connectionInfo))){
    
echo "Connection could not be established. ";
www~phperz~com

    
die(print_r(sqlsrv_errors(),true));
}
$tSQL="SELECT login_mail FROM account";
if(!($stmt=sqlsrv_query($conn,$tSQL))){
    
echo "Error in statement. ";
    
die(print_r(sqlsrv_errors(),true));
}
if(!(sqlsrv_fetch($stmt))){
php程序员站

                    
echo "Error in retrieving row. ";
                    
die(print_r(sqlsrv_errors(),true));
}
$loginmail=sqlsrv_get_field($stmt,1); phperz~com
echo $loginmail;

sqlsrv_close(
$conn);
?>
php程序员站

如果你在启动应用服务器时提示:
The application has failed to start because php5.dll was not found

缺少php5.dll
请访问:
或去PHP下载mirror包:

解开包后把php5.dll放入你的PHP根目录即可

原文地址:http://blog.csdn.net/xiaofanku/archive/2008/05/19/2456934.aspx

阅读(425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~