pagination in php [closed]

非 Y 不嫁゛ 提交于 2020-01-17 02:48:29

问题


want search result for displaying exactly same result as in : https://www.ippu.purdue.edu/GlobalLinkages/index.cfm?Location=.&Page=search

1 - 25 of 414 records Next >

I am using 3 inputs frm user ant it is same as link provided above


回答1:


Use MySQL's LIMIT and OFFSET constructs:

$offset = ($current_page - 1) * $items_per_page;
// in your query:
LIMIT $items_per_page OFFSET $offset



回答2:


I'd check out the Pager class in the PEAR repository. It's what I use for this sort of thing, and it has a bunch of options you can set.



来源:https://stackoverflow.com/questions/4857663/pagination-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!