summaryrefslogtreecommitdiff
path: root/it_dbi_postgres.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi_postgres.class')
-rw-r--r--it_dbi_postgres.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class
index 5caaba9..c26f5fc 100644
--- a/it_dbi_postgres.class
+++ b/it_dbi_postgres.class
@@ -108,7 +108,7 @@ function _query($query, $p)
$query .= ' RETURNING ' . $this->_escape_name($this->_p['keyfield']);
}
- if (!($result = pg_query($this->_link, $query)) && $p['safety'])
+ if (!($result = @pg_query($this->_link, $query)) && $p['safety'])
{
if (($p['safety'] < 2) && it::match('duplicate key value', pg_last_error($this->_link))) # Duplicate entry
return null;
@@ -122,7 +122,8 @@ function _query($query, $p)
}
*/
}
- else
+
+ if ($result)
{
$this->_affectedrows = pg_affected_rows($result);
$this->_insertid = $isinsert ? $this->_fetch_assoc($result)[$this->_p['keyfield']] : 0;