Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing insert query
  • Loading branch information
Evan Langlais committed Apr 29, 2019
1 parent 77a9435 commit 088684f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway.go
Expand Up @@ -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)
Expand Down

0 comments on commit 088684f

Please sign in to comment.