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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user