]> git.joonet.de Git - adminer.git/commitdiff
Last page with empty result (thanks to Frantisek Svoboda)
authorJakub Vrana <jakub@vrana.cz>
Mon, 18 Oct 2010 20:17:43 +0000 (22:17 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 18 Oct 2010 20:20:17 +0000 (22:20 +0200)
adminer/select.inc.php

index 73c0bc77d992949803daa417cb5e30462a9799fd..80aec73ed016a1abcf2face47bec9660c1b5f038 100644 (file)
@@ -209,7 +209,7 @@ if (!$columns) {
        $page = $_GET["page"];
        if ($page == "last") {
                $found_rows = $connection->result("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
-               $page = floor(max(0, ($found_rows - 1) / $limit);
+               $page = floor(max(0, $found_rows - 1) / $limit);
        }
 
        $query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");