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

* fixed affectedRows & insertId bug

This commit is contained in:
David Grudl
2007-03-26 06:22:53 +00:00
parent 4d2c90ba68
commit f64a5d5251
16 changed files with 24 additions and 674 deletions

View File

@@ -74,20 +74,20 @@ class DibiSqliteDriver extends DibiDriver {
{
$this->insertId = $this->affectedRows = FALSE;
$errorMsg = '';
$this->errorMsg = '';
$res = @sqlite_query($this->conn, $sql, SQLITE_ASSOC, $this->errorMsg);
if ($res === FALSE) return FALSE;
if (is_resource($res))
return new DibiSqliteResult($res);
$this->affectedRows = sqlite_changes($this->conn);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
$this->insertId = sqlite_last_insert_rowid($this->conn);
if ($this->insertId < 1) $this->insertId = FALSE;
if (is_resource($res))
return new DibiSqliteResult($res);
return TRUE;
}