PHP 高手进 在线等啊

来源:百度知道 编辑:UC知道 时间:2024/05/25 19:50:48
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\ymarticle\global.php on line 368

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\ymarticle\global.php on line 380
数据库连接失败

原因 : sql语句执行后的“返回类型”不是“资源”-result resource ;

在mysql_fetch_array()之前 echo mysql_error();

检查数据库配置文件。账号密码DBNAME什么的配置是否正确,连接是否正常

是你的SQL有语法错误,你在这个语句之前echo mysql_error();就知道原因了

mysql_fetch_array()的参数必须是记录集(result resource),比如:
$tempresult=mysql_query ("SQL语句");
while ($row = mysql_fetch_array($tempresult))
{
print $row[0]; //打印第一列的记录
print $row[1]; //打印第二列的记录
}

global.php错误在368到380啊

这个最好是把380 附近的代码发上来,要不然无法回答