Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\php\phpweb\EMS_Left.php on line 12 $tr = mysql_query("select * from `web_menu` where bid=".$pars["bid"]." and sid=".$srs["id"]." and view=1 and tid=0 order by sort asc");
  $row = mysql_num_rows($tr);

解决方案 »

  1.   

    SQL查询出了错估计是。输出一下SQL语句以及mysql_error();
      

  2.   

    array mysql_fetch_array ( resource $result [, int $ result_type ] )
    返回根据从结果集取得的行生成的数组,如果没有更多行则返回 FALSE。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, MYSQL_ASSOC)) {
            printf ("ID: %s  Name: %s", $row["id"], $row["name"]);
        }    mysql_free_result($result);<?php$link = mysql_connect("localhost", "mysql_user", "mysql_password");
    mysql_select_db("database", $link);$result = mysql_query("SELECT * FROM table1", $link);
    $num_rows = mysql_num_rows($result);echo "$num_rows Rows\n";?>
      

  3.   

    sql语句有问题 ,细心 !
      

  4.   

    order by sort   sort这是不是个关键字啊,不能有关键字