bugfix: don't fail when inserting multiple rows at once, and one of the values is NULL

This commit is contained in:
Sergey Tsalkov
2012-09-19 14:58:09 -07:00
parent ed9c29fe49
commit 2ffb770f8a
2 changed files with 12 additions and 3 deletions

View File

@@ -355,7 +355,7 @@ class MeekroDB {
$insert_values = array();
foreach ($keys as $key) {
if ($many && !isset($data[$key])) $this->nonSQLError('insert/replace many: each assoc array must have the same keys!');
if ($many && !array_key_exists($key, $data)) $this->nonSQLError('insert/replace many: each assoc array must have the same keys!');
$datum = $data[$key];
$datum = $this->sanitize($datum);
$insert_values[] = $datum;