From: jakubvrana Date: Thu, 7 Aug 2008 08:02:54 +0000 (+0000) Subject: Pages on last page X-Git-Tag: v3.0.0~1082 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=1456283e015906caecf8f436a0d7e88e40760781;p=adminer.git Pages on last page git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@434 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- 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) {