Warning: mysql_fetch_array():
程序员文章站
2024-01-13 20:52:10
...
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重复了.
教程地址:
欢迎转载!但请带上文章地址^^
上一篇: PHP去除换行符与PHP
推荐阅读
-
PHP Warning: date(): It is not safe to rely on the system&a
-
mysql_fetch_row,mysql_fetch_array,mysql_fetch_assoc的区别_PHP教程
-
使用php函数setcookie()报错:Warning: Cannot modify header
-
warning MSB3162: 所选的“Microsoft Report Viewer 2012 Runtim
-
PHP warning
-
Warning: mysql_fetch_array() expects parameter 1 to be resou_MySQL
-
PHP错误WARNING: SESSION_START() [FUNCTION.SESSION-START]解决方法_PHP教程
-
PHP warning
-
和mysql_fetch_array()结上的不解之缘.
-
PHP错误Warning:mysql_query()解决方法,warningmysql_query