这样的错误有谁见过,在网上也找不到,还有类似
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\web\common\mysql.class.php on line 126
 我在服务器上运行的程序就可以,我下到自己电脑上就老是有这个警告,我屏蔽就没数据读出来了。是不是我的环境的问题。
 谢谢大家 了。

解决方案 »

  1.   

    应该是你的返回结果不对,查看你ysql_fetch_array()的参数是什么结果?
      

  2.   


     mysql_connect("localhost", "mysql_user", "mysql_password") or
            die("Could not connect: " . mysql_error());
        mysql_select_db("mydb");    $result = mysql_query("SELECT id, name FROM mytable");    while ($row = mysql_fetch_array($result,)) {
            printf ("ID: %s  Name: %s", $row["id"], $row["name"]);
        }    mysql_free_result($result);
      

  3.   

    数据库没有连接成功,试试最简单的SQL语句吧。