title: "You have an error in your SQL syntax" when trying to insert data into MySQL
body: <p>I'm currently having an issue I really can't fix, I've researched on the internet, but the suggestions I find just don't work for me.</p>
  
  <p>I'm trying to make a registration system, just for fun not anything serious but I would gladly want to know what I'm doing wrong, since I could probably use this one day.</p>
  
  <p><a href="https://I.stack.imgur.com/AFkEp.png" rel="nofollow noreferrer"><img src="https://I.stack.imgur.com/AFkEp.png" alt="screenshot of the error"></a></p>
  
  <p>EDIT: I got the solution from @Gordon and many other suggestions which will probably be much usefull and i will look into trying all of the suggestions.</p>
  
  <p>Thank you so much =)</p>
  
  <p>And my code:</p>
  
  <pre><code>Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      mysqlconn = New MySqlConnection
      mysqlconn.ConnectionString = "server=localhost;userid=root;password=password;database=Mysql"
      Dim Reader As MySqlDataReader
  
      If TxT_User.Text = "" Or TxT_Pass1.Text = "" Or TxT_Pass2.Text = "" Or TxT_Email.Text = "" Or TxT_SC.Text = "" Then
          MsgBox("You need to fill out the required informations above", MsgBoxStyle.Critical)
      Else
          If TxT_Email.Text.Contains("@") Then
              If TxT_Pass2.Text = TxT_Pass1.Text Then
                  Try
                      mysqlconn.Open()
                      Dim Query As String
                      Query = "INSERT INTO syntax.members (Username, Password, Email, Secret Answer) VALUES ('" &amp; TxT_User.Text &amp; "', '" &amp; TxT_Pass1.Text &amp; "', '" &amp; TxT_Email.Text &amp; "', '" &amp; TxT_SC.Text &amp; "')"
                      cmd = New MySqlCommand(Query, mysqlconn)
                      Reader = cmd.ExecuteReader
  
                      MsgBox("Account created!", MsgBoxStyle.Information)
  
                      mysqlconn.Close()
                  Catch ex As MySqlException
                      MsgBox(ex.Message, MsgBoxStyle.Information)
                  Finally
                      mysqlconn.Dispose()
                  End Try
              Else
                  MsgBox("Your Password doesn't match the retyped version", MsgBoxStyle.Critical)
              End If
  
          Else
              MsgBox("Your email is not valid, please type a valid email address", MsgBoxStyle.Critical)
          End If
      End If
  End Sub
  </code></pre>