diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 7af00a4d0b..ebff64b810 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -134,7 +134,7 @@ $sql = "SELECT * FROM phpgw_accounts $whereclause $orderclause"; if ($offset) { - $this->db->limit_query($sql,array($start,$offset),__LINE__,__FILE__); + $this->db->limit_query($sql,$start,__LINE__,__FILE__,$offset); } elseif ($start == 0 || $start && !$offset) { diff --git a/phpgwapi/inc/class.db_mssql.inc.php b/phpgwapi/inc/class.db_mssql.inc.php index b756d9cb7b..484ce30af3 100644 --- a/phpgwapi/inc/class.db_mssql.inc.php +++ b/phpgwapi/inc/class.db_mssql.inc.php @@ -73,25 +73,21 @@ class db { return $this->Query_ID; } - function limit_query($Query_String, $_offset, $line = '', $file = '') + // public: perform a query with limited result set + function limit_query($Query_String, $offset, $line = '', $file = '', $num_rows = '') { global $phpgw_info; + if (! $num_rows) + { + $num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs']; + } + if ($this->Debug) { printf("Debug: limit_query = %s
offset=%d, num_rows=%d
\n", $Query_String, $offset, $num_rows); } - if (is_array($_offset)) - { - list($offset,$num_rows) = $_offset; - } - else - { - $num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs']; - $offset = $_offset; - } - $this->query($Query_String, $line, $file); if ($this->Query_ID) { diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 781a558139..1a84e55fe7 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -168,18 +168,13 @@ class db { } // public: perform a query with limited result set - function limit_query($Query_String, $_offset, $line = '', $file = '') + function limit_query($Query_String, $offset, $line = '', $file = '', $num_rows = '') { global $phpgw_info; - if (is_array($_offset)) - { - list($offset,$num_rows) = $_offset; - } - else + if (! $num_rows) { $num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs']; - $offset = $_offset; } if ($offset == 0) diff --git a/phpgwapi/inc/class.db_pgsql.inc.php b/phpgwapi/inc/class.db_pgsql.inc.php index e361baf0e6..faba086b60 100644 --- a/phpgwapi/inc/class.db_pgsql.inc.php +++ b/phpgwapi/inc/class.db_pgsql.inc.php @@ -112,18 +112,13 @@ class db { } // public: perform a query with limited result set - function limit_query($Query_String, $_offset, $line = '', $file = '') + function limit_query($Query_String, $offset, $line = '', $file = '', $num_rows = '') { global $phpgw_info; - if (is_array($_offset)) - { - list($offset,$num_rows) = $_offset; - } - else + if (! $num_rows) { $num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs']; - $offset = $_offset; } if ($offset == 0)