From bb855aaa9bafe9da03a6ffcf8b44a909199bbff9 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 7 Nov 2020 15:17:58 +0100 Subject: [PATCH] Changed endpoints and db queries, chart now shows suggested mins and maxes --- Database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database.go b/Database.go index b8fe057..6f2deec 100644 --- a/Database.go +++ b/Database.go @@ -27,7 +27,7 @@ func CloseDb() { } func writeSnapshotToDb(snapshotSub *SnapshotSubmission) (int64, error) { - queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, '%v', NULL);" + queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (?, ?, ?, '?', NULL);" query, err := ClimateDb.Prepare(queryStr) if err != nil { return -1, fmt.Errorf("couldn't prepare snapshot query: %w", err)