Object Oriented PHP: Paging Result Sets
http://www.webmasterbase.com/article/662Building A Dynamic MySQL Paging Class With PHP
http://www.devarticles.com/art/1/110/2
http://www.webmasterbase.com/article/662Building A Dynamic MySQL Paging Class With PHP
http://www.devarticles.com/art/1/110/2
解决方案 »
- php读写pgsql里的数组
- wml 与 php的问题 在线等待,请高手帮忙。
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\php\study\select.php on line 14
- apache 运行100%的问题,求求各位老前辈,
- 链接切割
- php 怎么发送邮件
- iconv问题,不知道如何解决
- 小菜鸟的大问题
- 谁能谈谈php与web services
- 可稳定支持PHP的虚拟主机,现在这种服务不多了~~~~~~~~~~~~~~
- 一个关于对象的奇怪问题。
- PHP+XML做一个树型结构
在要换行处插入:
<br style='page-break-after: always'>
注:在此行后插入页分割符。
更多用法请参照CSS。
http://www.ccidnet.com/tech/web/2001/05/22/58_2197.html
很经典的
<?
//分页函数/**
* Short description.
*
* Detail description
* @param $offset 本页第一条记录在全部查询结果中的位置
* @param $pagelines 每页的行数
* @param $filename 调用本函数的文件名(即包含查询语句的那个文件名
* @param $sn 欲参与分页显示的记录的总行数
* @global none
* @since 1.0
* @access private
* @return void
* @update date time
*/
function pagedivide($offset,$pagelines,$filename,$sn)
{
if (empty($offset)){
$offset=0;
}
?>
<div align="right"><font color="#FF0000" size="2">
<?if ($offset!=0){$preoffset=$offset-$pagelines;?>
<A HREF="<? echo $filename;?>?offset=<?echo $preoffset;?>&pagelines=<?echo $pagelines;?>">上一页</A>
<?}//if结束 如果偏移量是0,则没有上一页链接
$page_cnt=ceil($sn/$pagelines);
for ($j=1;$j<=$page_cnt ;$j++ ) {
$page_offset=$pagelines*$j-$pagelines;
?>
<A HREF="<?echo $filename;?>?offset=<?echo $page_offset;?>&pagelines=<?echo $pagelines;?>"><?echo $j;?></A>
<?}//for结束 显示到所有页的链接
if ($page_cnt!=0 && (($offset+$pagelines)/$pagelines)!=$page_cnt) {
$backoffset=$offset+$pagelines;
?>
<A HREF="<?echo $filename;?>?offset=<?echo $backoffset;?>&pagelines=<?echo $pagelines;?>">下一页</A><?}//if结束,检查是否到了最后一页?></font></div>
<?
} // end func
?>