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

php连接sqlserver

WBOY
WBOYOriginal
2016-06-23 14:35:18956browse

 

1.配置php.ini(如果是PHPNow,则可能是apache2handler.ini),去掉extension=php_mysql.dll前面的;

2.将php_mssql.dll 复制到system32的系统目录中去
3.把ntwdblib.dll 复制到system32的系统目录中去(这个安装PHPNow时可能能已拷贝过去)
3.重起服务器

测试

$odb_conn=mssql_connect('localhost','sa','');
    mssql_select_db('test',$odb_conn);
$query="select * from test1";
$odb_comm=mssql_query($query);
$odb_row_num=mssql_num_rows($odb_comm);
for($i=0;$i{
$row=mssql_fetch_array($odb_comm);
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
Previous article:PHP 的变量Next article:php生成XML