Home > Backend Development > PHP Tutorial > mysql异常,

mysql异常,

WBOY
Release: 2016-06-13 13:36:10
Original
918 people have browsed it

mysql错误,急!
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in D:\wamp1\www\empmanage\empMain.php on line 37
   
大致代码如下
  $sql="select * from emp limit".($pageNow-1)*$pageSize.",$pageSize";
  $res2=mysql_query($sql,$conn);
37行 while($row=mysql_fetch_assoc($res2)){
echo "

{$row['id']} {$row['name']} {$row['grade']}".
"{$row['email']} {$row['salary']}".
"删除用户 修改用户 ";
}
echo "";
解释下这句话是什么原因。

------解决方案--------------------
意思是36返回的不是resource而是boolen的false
36行改成 $res2=mysql_query($sql,$conn) or die(mysql_error());
看输出什么?
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template