This is my 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 near 'Key) VALUES ('biaprot','4E0658D00F47D86D19A0E792E...' at line 1.
My code :
private bool validate_register(string user, string pass)
{
db_connection();
MySqlCommand cmd = new MySqlCommand();
cmd.CommandText = "INSERT INTO accounts (Username,Key) VALUES (@user,@pass)";
cmd.Parameters.AddWithValue("@user", user);
cmd.Parameters.AddWithValue("@pass", pass);
cmd.Connection = connect;
MySqlDataReader login = cmd.ExecuteReader();
if (login.Read())
{
connect.Close();
return true;
}
else
{
connect.Close();
return false;
}
}
private void button1_Click(object sender, EventArgs e)
{
string user = textBox1.Text;
string pass = GetWP(textBox3.Text);
string pass2 = GetWP(textBox4.Text);
I use WhirlPool Hash to Encoded my password . Pls help me , thanks you
key
is a mysql keyword, to use it as a column name you have to quote it in backticks