Update database.php

This commit is contained in:
Namhyeon Go 2018-06-25 16:32:14 +09:00 committed by GitHub
parent b99e45ee48
commit 678958992b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,6 +213,10 @@ if(!function_exists("get_page_range")) {
function get_page_range($page=1, $limit=0) { function get_page_range($page=1, $limit=0) {
$append_sql = ""; $append_sql = "";
if($page < 1) {
$page = 1;
}
if($limit > 0) { if($limit > 0) {
$record_start = ($page - 1) * $limit; $record_start = ($page - 1) * $limit;
$record_end = $record_start + $limit - 1; $record_end = $record_start + $limit - 1;