query('CREATE TABLE IF NOT EXISTS Data (Id integer PRIMARY KEY AUTOINCREMENT, JsonData TEXT, Timestamp DATETIME DEFAULT CURRENT_TIMESTAMP )'); $query = $db->query("SELECT Id, JsonData, Timestamp FROM Data WHERE ID>21"); $Date1=array(); $Date2=array(); $Vbat=array(); $Temp=array(); while ($entry = $query->fetchArray(SQLITE3_ASSOC)) { $Parsed=json_decode ( str_replace(""", "\"", $entry['JsonData']), true); if ($Parsed) { if (key_exists("Vbat", $Parsed["BeeStalkerPiHatMk1"])) { if ($Parsed["BeeStalkerPiHatMk1"]["Serial"]=="BeeStalkerMk1-1-2016-04-06-0-1-1") { array_push($Date1, $entry["Timestamp"]); array_push($Date2, $entry["Timestamp"]); array_push($Vbat, $Parsed["BeeStalkerPiHatMk1"]["Vbat"]); array_push($Temp, $Parsed["BeeStalkerPiHatMk1"]["Temp"]); // echo $Parsed["BeeStalkerPiHatMk1"]["Vbat"]; } } } } ?>

Vbat

Temp