读取表中的数据,并且分页
//分页算法
$pagesize = 10; //读取10条数据
$pagenum = $GET['page'] ? $GET['page'] : 1; //检索当前在第几页
$offset = ($pagenume - 1) * $pagesize;
$sql = “SELECT * FROM income
order by id {$offset},{$pagesize} “;
//获取上下页
$nextpage = $pagenum + 1;
$prevpage = $pagenum - 1;
输出