summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-01-19 07:46:23 +0000
committerTomas V.V.Cox <cox@php.net>2002-01-19 07:46:23 +0000
commit87530cf81911f092eb814fb64989942a13a028de (patch)
treed95493712bd37ca096ec3629b68046e387edc469
parent34cfada44793ec205ee73e47025a5b7b24f4ae25 (diff)
downloadphp-git-87530cf81911f092eb814fb64989942a13a028de.tar.gz
Stores limit_from and limit_count as DB_result proporties instead
of DB_common. Fixs bug when doing queries inside limitQuery results.
-rw-r--r--pear/DB.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/pear/DB.php b/pear/DB.php
index b2c76899fb..71d0a5ca9b 100644
--- a/pear/DB.php
+++ b/pear/DB.php
@@ -627,6 +627,17 @@ class DB_result
var $dbh;
var $result;
var $row_counter = null;
+ /**
+ * for limit queries, the row to start fetching
+ * @var integer
+ */
+ var $limit_from = null;
+
+ /**
+ * for limit queries, the number of rows to fetch
+ * @var integer
+ */
+ var $limit_count = null;
/**
* DB_result constructor.
@@ -658,19 +669,19 @@ class DB_result
$fetchmode = DB_FETCHMODE_ASSOC;
$object_class = $this->dbh->fetchmode_object_class;
}
- if ($this->dbh->limit_from !== null) {
+ if ($this->limit_from !== null) {
if ($this->row_counter === null) {
- $this->row_counter = $this->dbh->limit_from;
+ $this->row_counter = $this->limit_from;
// For Interbase
if ($this->dbh->features['limit'] == false) {
$i = 0;
- while ($i++ < $this->dbh->limit_from) {
+ while ($i++ < $this->limit_from) {
$this->dbh->fetchInto($this->result, $arr, $fetchmode);
}
}
}
if ($this->row_counter >= (
- $this->dbh->limit_from + $this->dbh->limit_count))
+ $this->limit_from + $this->limit_count))
{
return null;
}
@@ -717,19 +728,19 @@ class DB_result
$fetchmode = DB_FETCHMODE_ASSOC;
$object_class = $this->dbh->fetchmode_object_class;
}
- if ($this->dbh->limit_from !== null) {
+ if ($this->limit_from !== null) {
if ($this->row_counter === null) {
- $this->row_counter = $this->dbh->limit_from;
+ $this->row_counter = $this->limit_from;
// For Interbase
if ($this->dbh->features['limit'] == false) {
$i = 0;
- while ($i++ < $this->dbh->limit_from) {
+ while ($i++ < $this->limit_from) {
$this->dbh->fetchInto($this->result, $arr, $fetchmode);
}
}
}
if ($this->row_counter >= (
- $this->dbh->limit_from + $this->dbh->limit_count))
+ $this->limit_from + $this->limit_count))
{
return null;
}