1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

* fixed pg_affected_rows

This commit is contained in:
David Grudl
2007-08-28 21:41:15 +00:00
parent 5243122e6a
commit 0ff0cd21df

View File

@@ -85,20 +85,21 @@ class DibiPostgreDriver extends DibiDriver
{
$this->affectedRows = FALSE;
$connection = $this->getConnection();
$res = @pg_query($connection, $sql);
$res = @pg_query($this->getConnection(), $sql);
if ($res === FALSE) return FALSE;
if ($res === FALSE) {
return FALSE;
$this->affectedRows = pg_affected_rows($connection);
} elseif (is_resource($res)) {
$this->affectedRows = pg_affected_rows($res);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
if (is_resource($res)) {
return new DibiPostgreResult($res);
}
} else {
return TRUE;
}
}