cvs: pear /MDB common.php
| From: | Lukas Smith | Date: | Thu, 18 Jul 2002 20:00:58 +0000 |
| Subject: | cvs: pear /MDB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5185@lists.php.net to get a copy of this message | ||
lsmith Thu Jul 18 16:00:58 2002 EDT
Modified files:
/pear/MDB common.php
Log:
tried to fix replace (still getting errors with the pgsql driver though)
Index: pear/MDB/common.php
diff -u pear/MDB/common.php:1.29 pear/MDB/common.php:1.30
--- pear/MDB/common.php:1.29 Wed Jul 17 10:36:36 2002
+++ pear/MDB/common.php Thu Jul 18 16:00:54 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: common.php,v 1.29 2002/07/17 14:36:36 lsmith Exp $
+// $Id: common.php,v 1.30 2002/07/18 20:00:54 lsmith Exp $
//
// Base class for DB implementations.
//
@@ -1321,11 +1321,11 @@
return $this->raiseError(DB_ERROR_UNSUPPORTED, "", "",
'Set selected row range: selecting row ranges is not supported by this
driver');
}
- if (gettype($first)!= "integer" || $first < 0) {
+ if (gettype($first) != "integer" || $first < 0) {
return $this->raiseError(DB_ERROR_SYNTAX, "", "",
'Set selected row range: it was not specified a valid first selected range
row');
}
- if (gettype($limit)!= "integer" || $limit < 1) {
+ if (gettype($limit) != "integer" || $limit < 1) {
return $this->raiseError(DB_ERROR_SYNTAX, "", "",
'Set selected row range: it was not specified a valid selected range row
limit');
}
@@ -1516,7 +1516,8 @@
{
return $result;
}
- if (!MDB::isError($success = $this->queryOne("SELECT COUNT(*) FROM
$table$condition", $affected_rows, "integer"))) {
+ $affected_rows = $this->queryOne("SELECT COUNT(*) FROM $table$condition",
"integer");
+ if (!MDB::isError($affected_rows)) {
switch($affected_rows) {
case 0:
$success = $this->query("INSERT INTO $table ($insert) VALUES
($values)");
@@ -1531,6 +1532,8 @@
'replace keys are not unique');
break;
}
+ } else {
+ $success = $affected_rows;
}
if (!$in_transaction) {