修改后的Pagination.php
比方每页显示3条,修改后的URL会变成index.php/con/1
index.php/con/2
index.php/con/3
index.php/con/4
而原来是
index.php/con/
index.php/con/3
index.php/con/6
index.php/con/9
不过在 SQL 那里需要这样写
$offset = ($_GET['p'] - 1) * $num_pages;
select * from usertable limit $offset, $num_pages 呵呵,也就是把原来的偏移量改成了真正的页数。
页:
[1]