title: MySql Syntax error: You have an error in your SQL syntax near '' at line 1
body: <p><strong>EDIT:</strong> Apologies for the stupid question. My own lapse in concentration, plus the fact that I'm still just learning the SQL syntax kinda caused me to miss the issue.</p>
  
  <p><strong>Original Question:</strong> I have no clue as to what is going on here. I have tried several methods of inserting data, but none have worked so far, and I always get the same exception. I am uncertain what is causing the issue. Am I missing a command function or is there something wrong with the syntax?</p>
  
  <pre><code>string uName = "tess";
  string uPwd = "newpassword";
  int authorityLevel = 3;
  
  try
  {
      mySqlCommand = mySqlConnect.CreateCommand();
      mySqlCommand.CommandText = "INSERT INTO Users(UserName, UserPassword, AuthorityLevel) VALUES(\"" + uName + "\", \"" + uPwd + "\", " + authorityLevel + ";";
      mySqlCommand.ExecuteNonQuery();
  }
  catch ((MySql.Data.MySqlClient.MySqlException e)
  {
      Console.WriteLine(e.Message);
  }
  
  // Output:
  // You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  </code></pre>