-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
- bug report? yes
- feature request? no
- version: ~2.3@dev
Description
$database->query("
INSERT INTO product_stock_merchant_events (x, y, z)
SELECT
x, y, z
FROM product_stock_events
WHERE id IN (?)",
$stockEvent_ids);
when you try to call insert with select it crashes on
Invalid argument supplied for foreach()
File: ...\nette\database\src\Database\SqlPreprocessor.php:178
168: }
169:
170: if (is_array($value)) {
171: $vx = $kx = array();
172: if ($mode === 'auto') {
173: $mode = $this->arrayMode;
174: }
175:
176: if ($mode === 'values') { // (key, key, ...) VALUES (value, value, ...)
177: if (array_key_exists(0, $value)) { // multi-insert
178: foreach ($value[0] as $k => $v) {
179: $kx[] = $this->delimite($k);
180: }
181: foreach ($value as $val) {
182: $vx2 = array();
Metadata
Metadata
Assignees
Labels
No labels