Skip to content

Commit 4b1dd0d

Browse files
committed
issue #344 fix for onDuplicate.
1 parent 44c8895 commit 4b1dd0d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

MysqliDb.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,15 @@ protected function _buildOnDuplicate($tableData)
10941094
if ($this->_lastInsertId)
10951095
$this->_query .= $this->_lastInsertId . "=LAST_INSERT_ID (".$this->_lastInsertId."), ";
10961096

1097-
$this->_buildDataPairs ($tableData, $this->_updateColumns, false);
1097+
foreach ($this->_updateColumns as $key => $val) {
1098+
// skip all params without a value
1099+
if (is_numeric ($key)) {
1100+
$this->_updateColumns[$val] = '';
1101+
unset ($this->_updateColumns[$key]);
1102+
} else
1103+
$tableData[$key] = $val;
1104+
}
1105+
$this->_buildDataPairs ($tableData, array_keys ($this->_updateColumns), false);
10981106
}
10991107
}
11001108

0 commit comments

Comments
 (0)