From d4d892f6f2455c02e20387b1f661701c9ddd21c8 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sun, 23 Jan 2022 16:43:48 +0000 Subject: [PATCH] Fixed MySQL server to allow external connections --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 2730028..6084a59 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,12 @@ func main() { } defer db.Close() //Make a Query to the database - db.Exec("INSERT INTO ") + insert, err := db.Query("INSERT INTO waypoints (name, type, frequency, longitude, latitude) VALUES ('WILLO', 'NDB', 12000, 'test', 'test')") //Close the connection - db.Close() + if err != nil { + fmt.Println(err) + } + if insert != nil { + fmt.Println("Success") + } }