我不能把
echo $output['description'].'<br />';
进入html表...
因为我希望我的表格如下所示:
<br />
<tr> Des: ['description']</tr><br />
<tr> Name: ['name']</tr><br />
<tr> Remark: ['remark']</tr><br />
$resultsPerPage = 10;
$startResults = ($page - 1) * $resultsPerPage;
$numberOfRows = mysql_num_rows(mysql_query('SELECT * FROM products'));
$totalPages = ceil($numberOfRows / $resultsPerPage);
$query = mysql_query("SELECT * FROM products LIMIT $startResults, $resultsPerPage");
while ($output = mysql_fetch_assoc($query))
echo $output['description'].'<br />';
echo $output['name'].'<br />';
echo $output['remark'].'<br />';
echo '<a href="?page=1">First</a> ';
if($page > 1)
echo '<a href="?page='.($page - 1).'">Back</a> ';
for($i = 1; $i <= $totalPages; $i++)
{
if($i == $page)
echo '<strong>'.$i.'</strong> ';
else
echo '<a href="?page='.$i.'">'.$i.'</a> ';
}
if ($page < $totalPages)
echo '<a href="?page='.($page + 1).'">Next</a> ';
echo '<a href="?page='.$totalPages.'">Last</a>';
?>