title: MySql.Data error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
body: <p>The following code:</p>
  <pre><code>string query = &quot;INSERT INTO `@tableName` (@tableKeys) VALUES(@tableValues)&quot;;
  
  MySqlCommand sql = new MySqlCommand(query);
  sql.Connection = connection;
  sql.Parameters.Add(new MySqlParameter(&quot;@tableName&quot;, values[0]));
  sql.Parameters.Add(new MySqlParameter(&quot;@tableKeys&quot;, values[1]));
  sql.Parameters.Add(new MySqlParameter(&quot;@tableValues&quot;, values[2]));
  sql.ExecuteNonQuery();
  </code></pre>
  <p>Returns the error:</p>
  <blockquote>
  <p>An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll</p>
  <p>Additional information: 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 ''porto,date') VALUES('232,17-11-2014 10:48:11')' at line 1</p>
  </blockquote>
  <p>And I call on the code using this:</p>
  <pre><code>string[] values = {&quot;logs&quot;,&quot;porto,date&quot;,num+&quot;,&quot;+date};
  bool dbopen = dbManager.OpenConnection();
  if(dbopen){
     dbManager.Insert(values);
  }
  </code></pre>
  <p>Can anyone please tell me what I'm doing wrong?</p>