cvs: php4 /pear DB.php /pear/DB common.php
| From: | Stig Bakken | Date: | Thu, 19 Apr 2001 21:54:38 +0000 |
| Subject: | cvs: php4 /pear DB.php /pear/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-56@lists.php.net to get a copy of this message | ||
ssb Thu Apr 19 14:54:38 2001 EDT
Modified files:
/php4/pear DB.php
/php4/pear/DB common.php
Log:
* fixed DB_common::getXxx when using the parameter array (didn't work before)
Index: php4/pear/DB.php
diff -u php4/pear/DB.php:1.60 php4/pear/DB.php:1.61
--- php4/pear/DB.php:1.60 Wed Apr 18 19:32:33 2001
+++ php4/pear/DB.php Thu Apr 19 14:54:37 2001
@@ -17,7 +17,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.60 2001/04/19 02:32:33 ssb Exp $
+// $Id: DB.php,v 1.61 2001/04/19 21:54:37 ssb Exp $
//
// Database independent query interface.
//
@@ -600,7 +600,7 @@
*/
function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
{
- $res = $this->fetchInto ($arr, $fetchmode, $rownum);
+ $res = $this->fetchInto($arr, $fetchmode, $rownum);
if ($res !== DB_OK) {
return $res;
}
@@ -618,7 +618,7 @@
*/
function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
{
- if ($fetchmode == DB_FETCHMODE_DEFAULT) {
+ if ($fetchmode === DB_FETCHMODE_DEFAULT) {
$fetchmode = $this->dbh->fetchmode;
}
return $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.45 php4/pear/DB/common.php:1.46
--- php4/pear/DB/common.php:1.45 Wed Apr 18 19:37:47 2001
+++ php4/pear/DB/common.php Thu Apr 19 14:54:37 2001
@@ -418,33 +418,30 @@
settype($params, "array");
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
-
if (DB::isError($sth)) {
return $sth;
}
$res = $this->execute($sth, $params);
} else {
- $res = $this->simpleQuery($query);
+ $res = $this->query($query);
}
if (DB::isError($res)) {
return $res;
}
-
- $row = $this->fetchRow($res, DB_FETCHMODE_ORDERED);
- if (DB::isError($row)) {
- return $row;
+ $err = $res->fetchInto($row, DB_FETCHMODE_ORDERED);
+ if ($err === null || DB::isError($err)) {
+ return $err;
}
- $ret = &$row[0];
- $this->freeResult($res);
+ $res->free();
if (isset($sth)) {
$this->freeResult($sth);
}
- return $ret;
+ return $row[0];
}
// }}}
@@ -475,20 +472,20 @@
}
$res = $this->execute($sth, $params);
} else {
- $res = $this->simpleQuery($query);
+ $res = $this->query($query);
}
if (DB::isError($res)) {
return $res;
}
- $row = $this->fetchRow($res, $fetchmode);
+ $err = $res->fetchInto($row, $fetchmode);
- if (DB::isError($row)) {
- return $row;
+ if ($err === null || DB::isError($err)) {
+ return $err;
}
- $this->freeResult($res);
+ $err->free();
if (isset($sth)) {
$this->freeResult($sth);