刚看的某教程,他那没问题,怎么到我这就有问题include 'page.class.php';$link = mysql_connect('localhost','root','');
mysql_select_db('xsphpdb');
$result = mysql_query("select * from shops");$total = mysql_num_rows($result);
$num = 10;
$page = new Page($total,$num);
$sql = "select * from shops{$page->limit}";
$result = mysql_query($sql);
echo '<table align = "center" border = 1 width = "960">';
echo '<caption><h1>shops</h1></caption>';while($row = mysql_fetch_assoc($result))
{
echo '<tr>';
echo '<td>'.$row["id"].'</td>';
echo '<td>'.$row['name'].'</td>';
echo '<td>'.$row['price'].'</td>';
echo '<td>'.$row['num'].'</td>';
echo '<td>'.$row['desn'].'</td>';
echo '</tr>';
}
echo '<tr><td colspan = "5" align = "right">'.$page->fpage().'</td></tr>';
echo '</table>';
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in