Skip to content

Instantly share code, notes, and snippets.

@imvkmark
Created March 31, 2013 14:51
Show Gist options
  • Save imvkmark/5280859 to your computer and use it in GitHub Desktop.
Save imvkmark/5280859 to your computer and use it in GitHub Desktop.
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment