1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-20 17:32:50 +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

@@ -84,7 +84,7 @@ class DibiMySqlDriver extends DibiDriver {
if (!empty($config['charset'])) {
$succ = @mysql_query("SET NAMES '" . $config['charset'] . "'", $conn);
@mysql_query("SET NAMES '" . $config['charset'] . "'", $conn);
// don't handle this error...
}
@@ -112,15 +112,15 @@ class DibiMySqlDriver extends DibiDriver {
if ($res === FALSE) return FALSE;
if (is_resource($res))
return new DibiMySqlResult($res);
$this->affectedRows = mysql_affected_rows($this->conn);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
$this->insertId = mysql_insert_id($this->conn);
if ($this->insertId < 1) $this->insertId = FALSE;
if (is_resource($res))
return new DibiMySqlResult($res);
return TRUE;
}