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,19 +85,20 @@ class DibiPostgreDriver extends DibiDriver
|
|||||||
{
|
{
|
||||||
$this->affectedRows = FALSE;
|
$this->affectedRows = FALSE;
|
||||||
|
|
||||||
$connection = $this->getConnection();
|
$res = @pg_query($this->getConnection(), $sql);
|
||||||
$res = @pg_query($connection, $sql);
|
|
||||||
|
|
||||||
if ($res === FALSE) return FALSE;
|
if ($res === FALSE) {
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
$this->affectedRows = pg_affected_rows($connection);
|
} elseif (is_resource($res)) {
|
||||||
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
|
$this->affectedRows = pg_affected_rows($res);
|
||||||
|
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
|
||||||
|
|
||||||
if (is_resource($res)) {
|
|
||||||
return new DibiPostgreResult($res);
|
return new DibiPostgreResult($res);
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
} else {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user