{
var $dbh;
var $result;
+ var $row_counter = null;
/**
* DB_result constructor.
$fetchmode = DB_FETCHMODE_ASSOC;
$return_object = true;
}
+ if ($this->dbh->limit_from !== null) {
+ if ($this->row_counter === null) {
+ $this->row_counter = $this->dbh->limit_from;
+ // For Interbase
+ if ($this->dbh->options['limit'] == false) {
+ $i = 0;
+ while ($i++ <= $this->dbh->limit_from) {
+ $this->dbh->fetchInto($this->result, $arr, $fetchmode);
+ }
+ }
+ }
+ if ($this->row_counter >= (
+ $this->dbh->limit_from + $this->dbh->limit_count))
+ {
+ return null;
+ }
+ if ($this->dbh->options['limit'] == 'emulate') {
+ $rownum = $this->row_counter;
+ }
+ $this->row_counter++;
+ }
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
if ($res !== DB_OK) {
return $res;
$fetchmode = DB_FETCHMODE_ASSOC;
$return_object = true;
}
+ if ($this->dbh->limit_from !== null) {
+ if ($this->row_counter === null) {
+ $this->row_counter = $this->dbh->limit_from;
+ // For Interbase
+ if ($this->dbh->options['limit'] == false) {
+ $i = 0;
+ while ($i++ <= $this->dbh->limit_from) {
+ $this->dbh->fetchInto($this->result, $arr, $fetchmode);
+ }
+ }
+ }
+ if ($this->row_counter >= (
+ $this->dbh->limit_from + $this->dbh->limit_count))
+ {
+ return null;
+ }
+ if ($this->dbh->options['limit'] == 'emulate') {
+ $rownum = $this->row_counter;
+ }
+ $this->row_counter++;
+ }
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
if (($res === DB_OK) && isset($return_object)) {
$class = $this->dbh->fetchmode_object_class;
{
return $this->dbh->tableInfo($this->result, $mode);
}
+
+ function getRowCounter()
+ {
+ return $this->row_counter;
+ }
}
class DB_row