From 62b57ea58c0e0ff2f3848fe01a4a43dfbfd26699 Mon Sep 17 00:00:00 2001 From: Lawrence Lagerlof Date: Tue, 5 Apr 2022 02:11:08 -0300 Subject: [PATCH] Fix: Columns must match as of the first row --- src/JSONDB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JSONDB.php b/src/JSONDB.php index aa7c49d..ab6911e 100644 --- a/src/JSONDB.php +++ b/src/JSONDB.php @@ -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; }