Created
March 31, 2013 14:51
-
-
Save imvkmark/5280859 to your computer and use it in GitHub Desktop.
php:pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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