1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00

* applied fetch modes patch for odbc by Richard M. Yumul

* added DB::isManip so we have _one_ place for testing whether something
  is a data manipulation query
* when passed a string as its first constructor arg, DB_Error now uses
  the error code DB_ERROR rather than just 0
* implemented auto-commit for ibase (not yet fully tested)
* fixed persistent connections in odbc
This commit is contained in:
Stig Bakken
2000-12-08 02:30:43 +00:00
parent 3288325bd4
commit efbc4a2566
+19 -1
View File
@@ -247,6 +247,24 @@ class DB
is_subclass_of($value, "db_error"));
}
/**
* Tell whether a query is a data manipulation query (insert, update
* or delete).
*
* @access public
*
* @param string the query
*
* @return bool whether $query is a data manipulation query
*/
function isManip($query)
{
if (preg_match('/^\s*(INSERT|UPDATE|DELETE)\s+/i', $query)) {
return true;
}
return false;
}
/**
* Tell whether a result code from a DB method is a warning.
* Warnings differ from errors in that they are generated by DB,
@@ -437,7 +455,7 @@ class DB_Error extends PEAR_Error
if (is_int($code)) {
$this->PEAR_Error("DB Error: " . DB::errorMessage( $code ), $code, $mode, $level, $debuginfo);
} else {
$this->PEAR_Error("DB Error: $code", 0, $mode, $level, $debuginfo);
$this->PEAR_Error("DB Error: $code", DB_ERROR, $mode, $level, $debuginfo);
}
}
}