Home >Backend Development >PHP Tutorial > 连接数据库时,报HTTP500异常

连接数据库时,报HTTP500异常

WBOY
WBOYOriginal
2016-06-13 12:32:451281browse

连接数据库时,报HTTP500错误
运行环境是:IIS7.0+PHP5.32+SQL2005
打开PHP网页正常,连接数据库里,报HTTP500错误。寻求解决方法。
连接数据库的代码如下:

//链接数据库 
 $conn=mssql_connect('127.0.0.1','KT99CtQC','C09076789101234w') or die('数据库连接不上'); 
   mssql_select_db('agencyhdfc',$conn); 
//query语句   
 $Query="select max(propertyno) from property where propertyno like 'xx%'"; 

$AdminResult=mssql_query($Query);
//输出结果
$Num=mssql_num_rows($AdminResult);
for($i=0;$i {
$Row=mssql_fetch_array($AdminResult);
echo($Row[0]);
echo("
");
}

 echo($row[0]); 

HTTP500错误
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