cvs: php4 /pear/DB common.php
| From: | Thomas V.V.Cox | Date: | Tue, 10 Jul 2001 22:07:59 +0000 |
| Subject: | cvs: php4 /pear/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-255@lists.php.net to get a copy of this message | ||
cox Tue Jul 10 18:07:59 2001 EDT
Modified files:
/php4/pear/DB common.php
Log:
fix bug when call excute multiple times (thanks to Oleg Rekutin and Paul
DuBois)
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.51 php4/pear/DB/common.php:1.52
--- php4/pear/DB/common.php:1.51 Wed May 30 17:06:04 2001
+++ php4/pear/DB/common.php Tue Jul 10 18:07:59 2001
@@ -265,6 +265,9 @@
function execute($stmt, $data = false)
{
$realquery = $this->executeEmulateQuery($stmt, $data);
+ if (DB::isError($realquery)) {
+ return $realquery;
+ }
$result = $this->simpleQuery($realquery);
if (DB::isError($result) || $result === DB_OK) {
return $result;
@@ -284,7 +287,6 @@
function executeEmulateQuery($stmt, $data = false)
{
$p = &$this->prepare_tokens;
- $stmt = (int)$this->prepare_maxstmt++;
if (!isset($this->prepare_tokens[$stmt]) ||
!is_array($this->prepare_tokens[$stmt]) ||
@@ -481,22 +483,22 @@
} else {
$res = $this->query($query);
}
-
+
if (DB::isError($res)) {
return $res;
}
-
+
$err = $res->fetchInto($row, $fetchmode);
-
+
if ($err !== DB_OK) {
return $err;
}
$res->free();
-
+
if (isset($sth)) {
$this->freeResult($sth);
}
-
+
return $row;
}