RSS订阅
PHP程序员站--WWW.PHPERZ.COM  
网站地图
高级搜索
收藏本站
 当前位置:主页 >> PHP基础 >> 基础文章 >> 文章内容
轻松搭建PHP5和SQL Server 2005开发环境
[收藏此页[打印本页]   
来源:blog.csdn.net  作者:  发布时间:2008-05-22

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.

www.phperz.com

访问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. www.phperz.com


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. www.phperz.com

配置: 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))){ www.phperz.com
    
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
请访问:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3175669&SiteID=1
或去PHP下载mirror包:
http://us3.php.net/get/php-5.2.5-nts-Win32.zip/from/a/mirror
解开包后把php5.dll放入你的PHP根目录即可

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

phperz~com


 
 相关文章
 
发表评论
全部评论(0条)
 
 站内搜索
 热门搜索 基础  mysql  adodb  url
高级搜索 网站地图 站长工具 IP查询 收藏本站
 热点文章
 随机推荐
网站首页 | 网站地图 | 高级搜索 | RSS订阅
PHP程序员站 Copyright © 2007,PHPERZ.COM All Rights Reserved 粤ICP备07503606号 联系站长