From 1456283e015906caecf8f436a0d7e88e40760781 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 7 Aug 2008 08:02:54 +0000 Subject: [PATCH] Pages on last page git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@434 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- functions.inc.php | 4 ++++ select.inc.php | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 022cd754..3305e9e2 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -201,6 +201,10 @@ function remove_from_uri($param = "") { return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"])); } +function print_page($page) { + echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . ""); +} + function get_file($key) { if (isset($_POST["files"][$key])) { $length = strlen($_POST["files"][$key]); diff --git a/select.inc.php b/select.inc.php index f373e818..dc139c34 100644 --- a/select.inc.php +++ b/select.inc.php @@ -236,11 +236,8 @@ function add_row(field) { echo "\n"; echo "

\n"; echo "\n"; - if (intval($limit) && $result->num_rows >= $limit && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) { + if (intval($limit) && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) { $max_page = floor(($found_rows - 1) / $limit); - function print_page($page) { - echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . ""); - } echo "

" . lang('Page') . ":"; print_page(0); if ($_GET["page"] > 3) {