fix: make sure $detections is iterable

This commit is contained in:
frederik
2025-11-19 18:13:11 +01:00
parent c1e70c3a2d
commit 3b36d2a2d3
+1
View File
@@ -28,6 +28,7 @@ $db->busyTimeout(1000);
$statement1 = $db->prepare('SELECT Sci_Name, Com_Name, COUNT(*) FROM detections WHERE Date BETWEEN "' . date("Y-m-d", $startdate) . '" AND "' . date("Y-m-d", $enddate) . '" GROUP By Sci_Name ORDER BY COUNT(*) DESC');
ensure_db_ok($statement1);
$result1 = $statement1->execute();
$detections = [];
while ($detection = $result1->fetchArray(SQLITE3_ASSOC)) {
$com_name = $detection["Com_Name"];
$sci_name = $detection["Sci_Name"];