时间:2021-07-01 10:21:17 帮助过:12人阅读
$conn = new com("adodb.connection");
$conn->open("driver={microsoft access driver (*.mdb)}; dbq=".db_path.";uid=;pwd=;");$rs=new com("adodb.recordset");
$rs->open("select * from [article] order by [articleid]",$conn,1,3);
$rs->pagesize=5;
$page=trim($_get['page']);
if($page=="" || is_numeric(intval($page))<=0){$page=1;}else if(intval($page)>$rs->pagecount){$page=$rs->pagecount;}
$page=intval($page);
if(!$rs->eof||$rs->bof){
$rs->absolutepage=$page; $mypagesize=$rs->pagesize; $i=$rs->recordcount()-($page-1)*$rs->pagesize;
while(!$rs->eof && $mypagesize>0 && $i>=$rs->recordcount()-1-$rs->pagesize*$page){
$articleid = $rs->fields(0)->value;
$articletitle = $rs->fields(1)->value; ?>
"> echo $articletitle; ?> echo $articlei; ?>
$rs->movenext; $mypagesize--; $i--; } } ?>
头页 1){echo $page-1;}else{echo 1;}?>">上页 pagecount){echo $page+1;}else{echo $rs->pagecount;}?>">下页 pagecount;?>">尾页 共 echo $rs->recordcount(); ?>篇文章,分 echo $rs->pagecount;?>页显示,现在是第 echo $page;?>页