From 088684fd0da39bb07547ef0c8ef4aea21e3b0f04 Mon Sep 17 00:00:00 2001 From: Evan Langlais Date: Mon, 29 Apr 2019 15:07:03 -0400 Subject: [PATCH] Fixing insert query --- gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway.go b/gateway.go index eac69fb..fd9ccc2 100644 --- a/gateway.go +++ b/gateway.go @@ -221,7 +221,7 @@ func (ws *socketConn) handleStatus(updates Packet) { if value == 0 { query = fmt.Sprintf("DELETE FROM `sd5-state`.%s WHERE gen_id = %d AND status_code = '%s'", table, generatorId, statusCode) } else { - query = fmt.Sprintf("INSERT INTO `sd5-state`.%s (gen_id, status_code) VALUES (%d, %s) ON DUPLICATE KEY UPDATE gen_id = VALUES(gen_id), status_code = VALUES(status_code)", table, generatorId, statusCode) + query = fmt.Sprintf("INSERT INTO `sd5-state`.%s (gen_id, status_code) VALUES (%d, '%s') ON DUPLICATE KEY UPDATE gen_id = VALUES(gen_id), status_code = VALUES(status_code)", table, generatorId, statusCode) } fmt.Println(query)