Re: [請益] 用while讀資料的話
我的做法會是這樣
===============================page.php======================================
<?php
......自己寫......
$str="select serial,time,title,count,name,email from $TBL_WEB";
$list=mysql_query($str,$link);
$num=mysql_num_rows($list);
for($i=1;$i<=ceil($num/8);$i++)
echo "<a href='view.php?page=".$i."'>第".$i."頁</a>";
?>
=============================================================================
===============================view.php======================================
<?
......自己寫......
$str="select serial,time,title,count,name,email from $TBL_WEB order by $sort
ASC limit ".($_GET['page']-1)*8.",8";
$list=mysql_query($str,$link);
while(list($serial,$time,$title,$count,$name,$email) = mysql_fetch_row($list)){
......自己寫......
}
include(page.php);
?>
=============================================================================
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.42.176
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章