From faaff37b2ac3d21a87f4c3a834231bdf0ab02fdd Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Tue, 3 Nov 2020 00:10:34 +0100 Subject: [PATCH] Got it working! --- climate-server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climate-server.go b/climate-server.go index 235bdfc..bfff0df 100644 --- a/climate-server.go +++ b/climate-server.go @@ -47,7 +47,7 @@ func saveSnapshot(w http.ResponseWriter, r *http.Request) error { if err != nil { return fmt.Errorf("couldn't create snapshot from JSON: %w", err) } - query := fmt.Sprintf("INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, `%v`, NULL);", + query := fmt.Sprintf("INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, %v, NULL);", snapshotSub.Temp, snapshotSub.Humidity, snapshotSub.Co2,