$PageSize = 18;
$StartRow = 0;
if(empty($_GET['PageNo'])){
if($StartRow == 0){
$PageNo = $StartRow + 1;
}
}else{
$PageNo = $_GET['PageNo'];
$StartRow = ($PageNo-1) * $PageSize;
}
if($PageNo % $PageSize == 0){
$CounterStart = $PageNo - ($PageSize - 1);
}else{
$CounterStart = $PageNo - ($PageNo % $PageSize) + 1;
}
$CounterEnd = $CounterStart + ($PageSize - 1);
if ($_GET['classID']<>""){
$TRecord = mysql_query("select * from bsw_news_jp where classID='".$_GET['classID']."'");
$result = mysql_query("select * from bsw_news_jp where classID='".$_GET['classID']."' order by uptime desc limit $StartRow,$PageSize");
$RecordCount = mysql_num_rows($TRecord);
}
else
{
$TRecord = mysql_query("select * from bsw_news_jp");
$result = mysql_query("select * from bsw_news_jp order by uptime desc limit $StartRow,$PageSize");
$RecordCount = mysql_num_rows($TRecord);
}
//获取总页数
$MaxPage = $RecordCount % $PageSize;
if($RecordCount % $PageSize == 0){
$MaxPage = $RecordCount / $PageSize;
}else{
$MaxPage = ceil($RecordCount / $PageSize);
}?>
$i = 1;
while ($row = mysql_fetch_array($result)) {
$bil = $i + ($PageNo-1)*$PageSize;?>
">
" alt=" echo $row["title"];?>">
$i++;}?>
