From 7052daef703634c03119a3c3a191f8c192c5a95a Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sun, 1 Nov 2020 01:47:46 +0100 Subject: [PATCH] finding a bug --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 87c88f1..d52e49c 100644 --- a/server.go +++ b/server.go @@ -61,11 +61,11 @@ func viewHandler(w http.ResponseWriter, r *http.Request) { log.Fatal(err) } _, 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.Humidity, snapshotSub.Timestamp, - snapshotSub.Co2) + snapshotSub.Co2)) if err != nil { fmt.Println(err.Error()) }