add missing reset for error variable in the db_pgsql class.

cosmetic changes in db_pgsql class.
This commit is contained in:
Clemens Schwaighofer
2014-01-23 12:57:57 +09:00
parent 0658514e2e
commit c0bbec3295

View File

@@ -2,8 +2,8 @@
/********************************************************************* /*********************************************************************
* $HeadURL: svn://svn/development/core_data/php/www/libs/db_pgsql.inc $ * $HeadURL: svn://svn/development/core_data/php/www/libs/db_pgsql.inc $
* $LastChangedBy: gullevek $ * $LastChangedBy: gullevek $
* $LastChangedDate: 2014-01-23 12:03:55 +0900 (Thu, 23 Jan 2014) $ * $LastChangedDate: 2014-01-23 12:57:54 +0900 (Thu, 23 Jan 2014) $
* $LastChangedRevision: 4835 $ * $LastChangedRevision: 4836 $
********************************************************************* *********************************************************************
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org) * AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
* CREATED: 2003/04/09 * CREATED: 2003/04/09
@@ -93,11 +93,10 @@
// DESC : wrapper for pg_get_result // DESC : wrapper for pg_get_result
public function _db_get_result() public function _db_get_result()
{ {
$this->last_error_query = '';
$result = pg_get_result($this->dbh); $result = pg_get_result($this->dbh);
if ($error = pg_result_error($result)) if ($error = pg_result_error($result))
{
$this->last_error_query = $error; $this->last_error_query = $error;
}
return $result; return $result;
} }
@@ -195,9 +194,9 @@
$_table = $array[2]; $_table = $array[2];
// if there is a dot inside, we need to split // if there is a dot inside, we need to split
if (strstr($_table, '.')) if (strstr($_table, '.'))
list($schema, $table) = explode('.', $_table); list($schema, $table) = explode('.', $_table);
else else
$table = $_table; $table = $_table;
// no PK name given at all // no PK name given at all
if (!$pk_name) if (!$pk_name)
{ {
@@ -210,7 +209,6 @@
$seq = (($schema) ? $schema.'.' : '').$table."_".$pk_name."_seq"; $seq = (($schema) ? $schema.'.' : '').$table."_".$pk_name."_seq";
$q = "SELECT CURRVAL('$seq') AS insert_id"; $q = "SELECT CURRVAL('$seq') AS insert_id";
// $this->currval_query = $q; // $this->currval_query = $q;
//echo "Q: $q<Br>";
// I have to do manually or I overwrite the original insert internal vars ... // I have to do manually or I overwrite the original insert internal vars ...
if ($q = $this->_db_query($q)) if ($q = $this->_db_query($q))
{ {
@@ -390,5 +388,5 @@
} }
} }
// $Id: db_pgsql.inc 4835 2014-01-23 03:03:55Z gullevek $ // $Id: db_pgsql.inc 4836 2014-01-23 03:57:54Z gullevek $
?> ?>