Skip to content

Commit

Permalink
Fix: Columns must match as of the first row
Browse files Browse the repository at this point in the history
  • Loading branch information
llagerlof committed Apr 5, 2022
1 parent 4c584eb commit 62b57ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JSONDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function insert($file, array $values)
}

foreach ($values as $col => $val) {
if (! isset($first_row[$col])) {
if (! array_key_exists($col, $first_row)) {
$unmatched_columns = 1;
break;
}
Expand Down

0 comments on commit 62b57ea

Please sign in to comment.