Commit 729e24fb authored by cobrafast's avatar cobrafast

Detect insert queries and return insert ID instead of an empty result.

parent 969945fd
......@@ -34,6 +34,8 @@ class MySQLiHelper
call_user_func_array(array($stmt, 'bind_param'), $param);
if ($stmt->execute() === false)
return false;
if (strpos($args[0], 'INSERT') === 0)
return $stmt->insert_id;
$yield = $stmt->get_result();
$stmt->close();
return $yield;
......@@ -62,4 +64,4 @@ class MySQLiHelper
{
return $this->sqli;
}
}
\ No newline at end of file
}
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