mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 09:04:24 +02:00
* added dibi::fetch, dibi::fetchAll, dibi::fetchSingle
* some bugs fixed
This commit is contained in:
@@ -250,7 +250,7 @@ class DibiOdbcDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
public function fetch()
|
||||
{
|
||||
return odbc_fetch_array($this->resultset, $this->row++);
|
||||
return odbc_fetch_array($this->resultset, ++$this->row);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -49,12 +49,6 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
private $resultset;
|
||||
|
||||
|
||||
/**
|
||||
* Cursor
|
||||
* @var int
|
||||
*/
|
||||
private $row = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Connects to a database
|
||||
@@ -204,7 +198,7 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
public function rowCount()
|
||||
{
|
||||
return $this->resultset->rowCount();
|
||||
throw new DibiDatabaseException('Row count is not available for unbuffered queries');
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +211,7 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
public function fetch()
|
||||
{
|
||||
return $this->resultset->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT, $this->row++);
|
||||
return $this->resultset->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +225,7 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
public function seek($row)
|
||||
{
|
||||
$this->row = $row;
|
||||
throw new DibiDatabaseException('Cannot seek an unbuffered result set');
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user