Commit 0fbd79b5 authored by Volker Krause's avatar Volker Krause
Browse files

Fix SQL syntax with MySQL for empty sample inserts

Fix by Aleix Pol, supersedes D6117.
parent 3bd81392
...@@ -176,7 +176,10 @@ class Sample ...@@ -176,7 +176,10 @@ class Sample
$sql .= ' (' . implode(', ', $columns) . ') VALUES ('; $sql .= ' (' . implode(', ', $columns) . ') VALUES (';
$sql .= implode(', ', $binds) . ')'; $sql .= implode(', ', $binds) . ')';
} else { } else {
$sql .= ' DEFAULT VALUES'; if ($db->driver() == 'sqlite')
$sql .= ' DEFAULT VALUES';
else
$sql .= ' VALUES ()';
} }
$stmt = $db->prepare($sql); $stmt = $db->prepare($sql);
foreach ($values as $key => $data) { foreach ($values as $key => $data) {
......
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