cvs: php4 /pear/DB common.php
| From: | Thomas V.V.Cox | Date: | Fri, 03 Aug 2001 16:20:58 +0000 |
| Subject: | cvs: php4 /pear/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-415@lists.php.net to get a copy of this message | ||
cox Fri Aug 3 12:20:58 2001 EDT
Modified files:
/php4/pear/DB common.php
Log:
Added DB_FETCHMODE_OBJECT support for getAll()
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.57 php4/pear/DB/common.php:1.58
--- php4/pear/DB/common.php:1.57 Fri Aug 3 10:17:31 2001
+++ php4/pear/DB/common.php Fri Aug 3 12:20:58 2001
@@ -17,6 +17,8 @@
// | |
// +----------------------------------------------------------------------+
//
+// $Id: common.php,v 1.58 2001/08/03 16:20:58 cox Exp $
+//
// Base class for DB implementations.
//
@@ -749,8 +751,8 @@
}
$results = array();
-
- while (is_array($row = $res->fetchRow($fetchmode))) {
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ while (DB_OK === $res->fetchInto($row, $fetchmode)) {
if ($fetchmode & DB_FETCHMODE_FLIPPED) {
foreach ($row as $key => $val) {
$results[$key][] = $val;
@@ -759,15 +761,16 @@
$results[] = $row;
}
}
- if (DB::isError($row)) {
- $results = $row;
- }
+ $this->popErrorHandling();
+
$res->free();
if (isset($sth)) {
$this->freeResult($sth);
}
-
+ if (DB::isError($row)) {
+ return $this->raiseError($row);
+ }
return $results;
}