diff --git a/climate-server.go b/climate-server.go index f35809f..235bdfc 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,