From 81c7d0be94cc3d385f6c699e99ff3e9c7f89eda8 Mon Sep 17 00:00:00 2001 From: jengo Date: Tue, 30 Jan 2001 00:12:27 +0000 Subject: [PATCH] Fixed limit(), I must have been a sleep when I wrote the function :) --- phpgwapi/inc/class.db_mysql.inc.php | 8 +++++--- phpgwapi/inc/class.db_pgsql.inc.php | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 574b2a8847..a33b0164ce 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -97,12 +97,14 @@ class db { return mysql_close($this->Link_ID); } - function limit($start,$offset) + function limit($start) { + global $phpgw_info; + if ($start == 0) { - $s = "limit $offset"; + $s = "limit " . $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]; } else { - $s = "limit $start,$offset"; + $s = "limit $start," . $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]; } return $s; } diff --git a/phpgwapi/inc/class.db_pgsql.inc.php b/phpgwapi/inc/class.db_pgsql.inc.php index b85fff4dda..36ec0b9caa 100644 --- a/phpgwapi/inc/class.db_pgsql.inc.php +++ b/phpgwapi/inc/class.db_pgsql.inc.php @@ -61,12 +61,14 @@ class db { } } - function limit($start,$offset) + function limit($start) { + global $phpgw_info; + if ($start == 0) { - $s = "limit $offset"; + $s = "limit " . $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]; } else { - $s = "limit $offset,$start"; + $s = "limit " . $phpgw_info["user"]["preferences"]["common"]["maxmatchs"] . ",$start"; } return $s; }