This commit is contained in:
PaulVua
2025-02-05 17:37:27 +01:00
parent 46303b9c19
commit d98eb48535
5 changed files with 284 additions and 71 deletions

View File

@@ -14,7 +14,7 @@ if ($type == "get_npm_sqlite_data") {
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Fetch the last 30 records
$stmt = $db->query("SELECT timestamp, PM1, PM25, PM10 FROM data ORDER BY timestamp DESC LIMIT 30");
$stmt = $db->query("SELECT timestamp, PM1, PM25, PM10 FROM data_NPM ORDER BY timestamp DESC LIMIT 30");
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
$reversedData = array_reverse($data); // Reverse the order