<?php  
       require("/var/www/betacom/Comment.php");
       $comment=new Comment();
       $result=$comment->viewcontent();//viewcontent()函数返回执行查询语句的数组

        echo "<table>\n";
        echo "<tr>\n";
        while($row=fetch_row($result))
        {
           
              echo '<td bgcolor="#00FF00">';
              echo "$row[1]";
              echo '</td>';              echo '<td bgcolor="#00FF00">';
              echo "$row[2]";
              echo '</td>';              echo '<td bgcolor="#00FF00">';
              echo "$row[3]";
              echo '</td>';
        }  
        echo "</tr>\n";
        echo "</table>\n";
      ?> 运行的时候错误提示如下:
Call to undefined function fetch_row() in /var/www/betacom/showlist.php on line 23

解决方案 »

  1.   

    fetch_row() --> mysql_fetch_row()
      

  2.   

    or maybe  $result->fetch_row();
      

  3.   

    $row=fetch_row($result)
    -->$row = $comment->fetch_row($result)
      

  4.   

    Fatal error: Call to a member function fetch_row() on a non-object in /var/www/betacom/showlist.php on line 23
      

  5.   

    都不知道你result是返回的什么东西。
      

  6.   

    result返回为结果集,有mysql_fetch_array
    有时候也用mysql_fetch_row