imvkmark
3/31/2013 - 2:51 PM

php:pagination

php:pagination

<?php
$pn = new Pagination();
$sql = "
    SELECT
        *
    FROM
        mg_form_team
    where
        userid={$_userid}
    LIMIT
        " . (($pn->get_page() - 1) * $records_per_page) . ", " . $records_per_page . "
";
$result = $db->query($sal);
$pn->labels('上一页', '下一页');
$re = array();
while($r = $db->fetch_array($result)) {
	$re[] = $r;
}
$pn->records($cnt);
$pn->records_per_page($records_per_page);
$pn->render();