Skip to content

Commit f2abde1

Browse files
author
Alin Olteanu
committed
insertMulti ... ON DUPLICATE KEY UPDATE
1 parent 20b47d7 commit f2abde1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/MysqliDb.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,13 @@ public function insertMulti($tableName, array $multiInsertData, array $dataKeys
10111011
}
10121012

10131013
if (!empty($update)) {
1014-
foreach ($update as $key) {
1015-
$this->_updateColumns[$key] = $insertData[$key] ?? null;
1014+
foreach ($update as $key => $value) {
1015+
if (is_numeric($key)) {
1016+
$key = $value;
1017+
$this->_updateColumns[$key] = $insertData[$key] ?? null;
1018+
} else {
1019+
$this->_updateColumns[$key] = $value;
1020+
}
10161021
}
10171022
}
10181023

0 commit comments

Comments
 (0)