首页 > 开发 > PHP > 正文

Warning: mysql_fetch_array():

2024-05-04 21:56:19
字体:
来源:转载
供稿:网友

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in 

  1. $connect=mysql_connect("localhost","root","123"or die("无法连接数据库".mysql_error()); 
  2.  
  3. mysql_select_db("cmstest"or die("无法选择数据库".mysql_errno()); 
  4.  
  5. $sql="select * from article where pid=1"
  6. $result=mysql_query($sql,$connector die("无法查询sql语句".mysql_error()); 
  7. $nums=mysql_num_rows($result); 
  8. echo "nums is:".$nums
  9. while($res=mysql_fetch_array($result)){     
  10. echo $res[0];   
  11. }  

原来是$result重复了.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表