summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-11-09 20:02:41 +0000
committerDries Buytaert <dries@buytaert.net>2002-11-09 20:02:41 +0000
commitc93ab2a21f816469f4fc0d9454e391fc29a9e59c (patch)
tree017a62943aa77765ff8b7c68b884e7eb2ecc00d7
parentc2f5ce820f75a3ecdbee70b5345daa05be2b897b (diff)
downloadbrdo-c93ab2a21f816469f4fc0d9454e391fc29a9e59c.tar.gz
brdo-c93ab2a21f816469f4fc0d9454e391fc29a9e59c.tar.bz2
- Added a db_query_range function. Patch by Natrak, slightly modified.
-rw-r--r--includes/database.mysql.inc32
-rw-r--r--includes/database.pear.inc18
2 files changed, 49 insertions, 1 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index 62e87f778..e3bd26d42 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -117,4 +117,36 @@ function db_affected_rows() {
return mysql_affected_rows();
}
+/**
+ * Generates a limited query
+ *
+ * @param string $query query
+ * @param integer $from the row to start to fetching
+ * @param integer $count the numbers of rows to fetch
+ *
+ * @return mixed a DB_Result object or a DB_Error
+ *
+ * @access public
+ */
+function db_query_range($query, $from, $count) {
+ $query .= " LIMIT $from, $count";
+ // TODO: debug version
+ return db_query($query);
+}
+
+/**
+ * Generates a limited query
+ *
+ * @param string $query query
+ * @param integer $from the row to start to fetching
+ * @param integer $count the numbers of rows to fetch
+ *
+ * @access public
+ */
+function db_query_range($query, $from, $count) {
+ $query .= " LIMIT $from, $count";
+ // TODO: debug version
+ return db_query($query);
+}
+
?> \ No newline at end of file
diff --git a/includes/database.pear.inc b/includes/database.pear.inc
index d404f1002..0c2c72f4d 100644
--- a/includes/database.pear.inc
+++ b/includes/database.pear.inc
@@ -112,4 +112,20 @@ function db_affected_rows() {
return $db_handle->affectedRows();
}
-?> \ No newline at end of file
+/**
+ * Generates a limited query
+ *
+ * @param string $query query
+ * @param integer $from the row to start to fetching
+ * @param integer $count the numbers of rows to fetch
+ *
+ * @return mixed a DB_Result object or a DB_Error
+ *
+ * @access public
+ */
+
+function db_query_range($query, $from, $count) {
+ return DB::limitQuery($query, $from, $count);
+}
+
+?>