warning: mysql_fetch_array(): supplied argument is not a valid mysql result resource in
$connect=mysql_connect("localhost","root","123") or die("无法连接数据库".mysql_error()); mysql_select_db("cmstest") or die("无法选择数据库".mysql_errno()); $sql="select * from article where pid=1"; $result=mysql_query($sql,$connect) or die("无法查询sql语句".mysql_error()); $nums=mysql_num_rows($result); echo "nums is:".$nums; while($res=mysql_fetch_array($result)){ echo $res[0]; }
原来是$result重复了.
教程地址:
欢迎转载!但请带上文章地址^^
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号