summaryrefslogtreecommitdiff
path: root/program/include/rcube_db.inc
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2005-10-20 16:58:34 +0000
committersvncommit <devs@roundcube.net>2005-10-20 16:58:34 +0000
commit53560c521e594d6047f58a25ccbc266c56bbcf05 (patch)
tree6703dcb8ef1319ee63c42f7edf6b769be070efda /program/include/rcube_db.inc
parentba94bf4282c142fb9e3d2c546c5ba8b6df2ac7e1 (diff)
added DB LIMIT abstraction
Diffstat (limited to 'program/include/rcube_db.inc')
-rwxr-xr-xprogram/include/rcube_db.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/program/include/rcube_db.inc b/program/include/rcube_db.inc
index 2b0c01af9..f732da298 100755
--- a/program/include/rcube_db.inc
+++ b/program/include/rcube_db.inc
@@ -103,7 +103,7 @@ class rcube_db
// Query database (read operations)
- function query($query)
+ function query($query, $offset=0, $numrows=0)
{
// Read or write ?
if (strtolower(trim(substr($query,0,6)))=='select')
@@ -115,8 +115,13 @@ class rcube_db
if ($this->db_provider == 'sqlite')
$query = $this->_sqlite_prepare_query($query);
-
- $result = $this->db_handle->query($query);
+
+ if ($numrows || $offset)
+ {
+ $result = $this->db_handle->limitQuery($query,$offset,$numrows);
+ }
+ else
+ $result = $this->db_handle->query($query);
if (DB::isError($result))
raise_error(array('code' => 500,