cvs: pear /DB/DB common.php
| From: | Stig Bakken | Date: | Sat, 08 Feb 2003 07:14:21 +0000 |
| Subject: | cvs: pear /DB/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8756@lists.php.net to get a copy of this message | ||
ssb Sat Feb 8 02:14:21 2003 EDT
Modified files:
/pear/DB/DB common.php
Log:
* add support for params in limitQuery(), thanks to aangenieux@clever-age.com
Index: pear/DB/DB/common.php
diff -u pear/DB/DB/common.php:1.12 pear/DB/DB/common.php:1.13
--- pear/DB/DB/common.php:1.12 Mon Jan 13 09:14:45 2003
+++ pear/DB/DB/common.php Sat Feb 8 02:14:21 2003
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: common.php,v 1.12 2003/01/13 14:14:45 mj Exp $
+// $Id: common.php,v 1.13 2003/02/08 07:14:21 ssb Exp $
//
// Base class for DB implementations.
//
@@ -745,21 +745,22 @@
// {{{ limitQuery()
/**
* Generates a limited query
- * *EXPERIMENTAL*
*
* @param string $query query
* @param integer $from the row to start to fetching
* @param integer $count the numbers of rows to fetch
+ * @param array $params required for a statement
*
- * @return mixed a DB_Result object or a DB_Error
+ * @return mixed a DB_Result object, DB_OK or a DB_Error
*
* @access public
*/
- function &limitQuery($query, $from, $count)
+ function &limitQuery($query, $from, $count, $params = array())
{
$query = $this->modifyLimitQuery($query, $from, $count);
- $result = $this->simpleQuery($query);
- if (DB::isError($result) || $result === DB_OK) {
+ $result = $this->query($query, $params);
+ if (DB::isError($result) || get_class($result) == 'db_result' ||
+ $result === DB_OK) {
return $result;
} else {
$options['limit_from'] = $from;
@@ -1382,4 +1383,4 @@
}
}
-?>
\ No newline at end of file
+?>