Commit 06f6a372 authored by Alexander Butenko's avatar Alexander Butenko

issue #150 Support for insert() without an insert id

parent a3f111b8
......@@ -317,8 +317,15 @@ class MysqliDb
$stmt->execute();
$this->_stmtError = $stmt->error;
$this->reset();
$this->count = $stmt->affected_rows;
if ($stmt->affected_rows < 1)
return false;
if ($stmt->insert_id > 0)
return $stmt->insert_id;
return ($stmt->affected_rows > 0 ? $stmt->insert_id : false);
return true;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment