From c3840a10defdf8a7a832dd1e521fcc870e84d39e Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 9 Jan 2020 20:23:27 +0900 Subject: [PATCH] Update database.php --- system/database.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/database.php b/system/database.php index ccaa192..90fa69c 100644 --- a/system/database.php +++ b/system/database.php @@ -287,7 +287,7 @@ if(!check_function_exists("exec_db_fetch")) { } elseif($fetch_mode == "php") { $_sql = $sql; $_rows = exec_db_fetch_all($sql, $bind); - $_rows = array_slice($_rows, $start, 1); + $_rows = array_slice($_rows, get_db_zero($start), 1); } // get first of rows @@ -304,9 +304,9 @@ if(!check_function_exists("get_page_range")) { $page = ($page > 1 ? $page : 1); if($limit > 0) { - $_START = ($page - 1) * $limit; - $_LIMIT = $limit; - $sql = sprintf(" limit %s, %s", get_db_zero($_START), $_LIMIT); + $_START = get_db_zero(($page - 1) * $limit); + $_LIMIT = get_db_zero($limit); + $sql = sprintf(" limit %s, %s", $_START, $_LIMIT); } return $sql;