finding a bug

This commit is contained in:
Daniel Ledda
2020-11-01 01:47:46 +01:00
parent fc9d12fcd7
commit 7052daef70

View File

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