Commit f889dbc3 authored by Alexander Butenko's avatar Alexander Butenko

Fix insert() for empty values array

parent be8b612f
...@@ -1331,7 +1331,9 @@ class MysqliDb ...@@ -1331,7 +1331,9 @@ class MysqliDb
$isInsert = preg_match('/^[INSERT|REPLACE]/', $this->_query); $isInsert = preg_match('/^[INSERT|REPLACE]/', $this->_query);
$dataColumns = array_keys($tableData); $dataColumns = array_keys($tableData);
if ($isInsert) { if ($isInsert) {
$this->_query .= ' (`' . implode($dataColumns, '`, `') . '`) VALUES ('; if (isset ($dataColumns[0]))
$this->_query .= ' (`' . implode($dataColumns, '`, `') . '`) ';
$this->_query .= ' VALUES (';
} else { } else {
$this->_query .= " SET "; $this->_query .= " SET ";
} }
......
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