diff --git a/select.inc.php b/select.inc.php index b256697d..1940078c 100644 --- a/select.inc.php +++ b/select.inc.php @@ -236,7 +236,7 @@ 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"))) > $limit) { + 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) { $max_page = floor(($found_rows - 1) / $limit); function print_page($page) { echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . "");