Call to a member function fetch_row() on a non-object的问题
运行出错:Fatal error: Call to a member function fetch_row() on a non-object in E:\AppServ\www\exercitation\Show.php on line 30
<?PHP
$existRecord = False;
$objContent = new Content();
$results = $objContent->load_content_byPage($pageNo, $pageSize);
// 使用while语句显示所有$results中的留言数据
while($row = $results->fetch_row()) { //第30行
$existRecord = True;
?>
最后也有如果没数据输出了。
<?PHP
} // end of while
if(!$existRecord) {
?>
<tr>
<td width="148" height="16" align=center class="main">没有留言数据</td>
</tr>
<?PHP
} // end of if
echo("</table></center></div>");
} // end of function
?>
数据库连接是没问题的。数据也有手动插入了。