fixed total page number

This commit is contained in:
printempw 2016-03-27 12:52:57 +08:00
parent 424d198db9
commit e4a30c149c

View File

@ -33,11 +33,12 @@
if (isset($_POST['search-username'])) {
$result = $db->query("SELECT * FROM users WHERE `username` LIKE '%".$_POST['search-username']."%' ORDER BY `uid` LIMIT ".(string)(($page_now-1)*30).", 30");
$page_total = $db->query("SELECT * FROM users WHERE `username` LIKE '%".$_POST['search-username']."%'")->num_rows/30;
} else {
$result = $db->query("SELECT * FROM users ORDER BY `uid` LIMIT ".(string)(($page_now-1)*30).", 30");
$page_total = $db->query("SELECT * FROM users WHERE 1")->num_rows/30;
}
$page_total = round($result->num_rows/30);
while ($row = $result->fetch_array()) { ?>
<tr>
<td><?php echo $row['uid']; ?></td>