程序一:这个错误if ($chid=0),先改了看看(应为$chid==0)程序二:如果数据表里没资料当然为空

解决方案 »

  1.   

    我已经改了还是没用数据表不是空的!
    +---------+------------+------+---------------------+-----------+
    | user_id | user_name  | view | last_time           | password  |
    +---------+------------+------+---------------------+-----------+
    |       1 | 94high.com | 4568 | 2003-06-06 10:23:19 | *******t  |
    |       3 | quchao.net |    2 | 2003-06-04 16:19:27 | ********  |
    +---------+------------+------+---------------------+-----------+
      

  2.   

    //干脆先再加点判断,并用mysql_fetch_array代替mysql_fetch_object试试
    $result=mysql_query($query);
    if ($result===FALSE)
    {
    echo "SQL执行错误!";
    }
    while($row=mysql_fetch_array($result))
    {
    echo $row[0];
    echo $row[1];
    echo $row[2];
    echo $row[3];
    }
      

  3.   

    $query="select * from user;";同时把这的分号去掉,用mysql_fetch_array()试试
      

  4.   

    谢谢个位,现在有显示,可是显示完了,程序还一直在执行,不结束?
    <?php
    $username="94high.com";
    require 'conn.php';
    $query="select * from user;";
    $result=mysql_query($query);
    if ($result==FALSE)
    {
    echo "SQL执行错误!";
    }
    while($row=mysql_fetch_array($result))
    {
    echo $row[user_id]."|";
    echo $row[user_name]."|";
    echo $row[view]."|";
    echo $row[last_time]."|";
    echo "<br>";
    }?>
      

  5.   

    另外我只想显示username="94high.com"的这一条纪录该怎么做?
      

  6.   

    楼主应该加强数据库方面的知识了select * from user where user_name = '94high.com'还有啊,记录循环读取完毕后程序就会完成的了。