我有一个应用程序在数据库中搜索活动作业,并将它们返回到结果列表中。该部分工作正常,但分页不起作用。当我点击链接转到下一个10个工作时,它只停留在同一页面上。为什么我的分页结果不起作用?
这里是代码的样子。
$currPage = (($s/$limit) + 1);
// Links to access additional results
if ($s>=1) {
$prevs=($s-$limit);
$upd_msg_prev = '<a href="'.$here.'?state='.$state.$cid_searched.'&s='.$prevs.'"><< Prev 10</a> | ';
if ($s>$numrows-10) {
$upd_msg_next = 'Next 10 >>';
}
} else {
if ($numrows>10) {
$upd_msg_prev = '<< Prev 10 | ';
}
}
$here = isset($_POST['here']);
// calculate number of pages needing links
$pages=intval($numrows/$limit);
// Check how many $pages are needed by getting total plus one if there's a remainder
if ($numrows%$limit) {
$pages++;
}
// check to see if last page
if (!((($s+$limit)/$limit)==$pages) && $pages!=1) {
$news=($s+$limit);
$upd_msg_next = '<a href="'.$here.'?state='.$state.$cid_searched.'&s='.$news.'">Next 10 >></a>';`
}
最后两行代码中存在一个错误。 – HeroFTime