diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 1db65ae28..d4622e583 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -261,7 +261,7 @@ function apply_sql_function($function, $column) { echo "\n"; echo "\n"; - $query = "SELECT " . (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : ""); + $query = "SELECT " . (intval($limit) && count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : ""); echo adminer_select_query($query); $result = $dbh->query($query);