finding a bug

This commit is contained in:
Daniel Ledda
2020-11-01 01:46:04 +01:00
parent 45b3cea9a1
commit fc9d12fcd7

View File

@@ -60,11 +60,14 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
if err != nil {
log.Fatal(err)
}
_, _ = climateDb.Query(
_, err = climateDb.Query(
"INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, %v, NULL);",
snapshotSub.Temp,
snapshotSub.Humidity,
snapshotSub.Timestamp,
snapshotSub.Co2)
if err != nil {
fmt.Println(err.Error())
}
}
}