Skip to content

Commit

Permalink
Merge pull request #37 from llagerlof/master
Browse files Browse the repository at this point in the history
Fix: Columns must match as of the first row
  • Loading branch information
donjajo authored Apr 8, 2022
2 parents 4c584eb + 62b57ea commit 45a6749
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 45a6749

Please sign in to comment.