diff --git a/ChangeLog b/ChangeLog index 7adc93b97..a3cd828f3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2001-08-04 Marc Delisle * ob_lib.inc.php3, oops: must be PHP3 compatible + * sql.php3: bug 447771 bad counting of entries, patch developed + from an idea of Ignacio Vazquez-Abrams (ivazquezabrams) 2001-08-04 Steve Alberty * lib.inc.php3: fixed #444017 (thanks anonymous) diff --git a/sql.php3 b/sql.php3 index fbd416b98..2b100aed1 100755 --- a/sql.php3 +++ b/sql.php3 @@ -131,7 +131,7 @@ else { } else if ($is_select) { // reads only the from-part of the query... - $array = split(' from | FROM ', $sql_query, 2); + $array = split(' from | FROM | order | ORDER | having | HAVING | limit | LIMIT | group by | GROUP BY', $sql_query); if (!empty($array[1])) { // ... and makes a count(*) to count the entries $count_query = 'SELECT COUNT(*) AS count FROM ' . $array[1];