I have a table named 'accounts' with a column called 'Rank' in my MySQL database. 'Rank' is a Length 2 INT type column.
My code for running my MySQL command is:
Command = CreateQuery();
Command.CommandText = "INSERT INTO accounts ([Rank]) VALUES (0)";
Command.ExecuteNonQuery();
However, when I attempt to run it I get this error:
MySql.Data.MySqlClient.MySqlException (0x80004005): 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 'Rank) VALUES (0)' at line 1
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at (***) in (***)Database.cs:line 113
Can anyone point out what is wrong with my syntax?