diff options
Diffstat (limited to 'inc/auth/mysql.class.php')
-rw-r--r-- | inc/auth/mysql.class.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/inc/auth/mysql.class.php b/inc/auth/mysql.class.php index 2642ebd4c..cc53ab073 100644 --- a/inc/auth/mysql.class.php +++ b/inc/auth/mysql.class.php @@ -242,9 +242,16 @@ class auth_mysql extends auth_basic { if($this->_openDB()) { $sql = $this->_createSQLFilter($this->cnf['getUsers'], $filter); - $result = $this->_queryDB($sql); - if ($result) - $rc = count($result); + + if ($this->dbver >= 4) { + $sql = substr($sql, 6); /* remove 'SELECT' or 'select' */ + $sql = "SELECT SQL_CALC_FOUND_ROWS".$sql." LIMIT 1"; + $this->_queryDB($sql); + $result = $this->_queryDB("SELECT FOUND_ROWS()"); + $rc = $result[0]['FOUND_ROWS()']; + } else if (($result = $this->_queryDB($sql))) + $rc = count($result); + $this->_closeDB(); } return $rc; |