08-04-2013, 04:09 PM
MySqlCommand cmd = new MySqlCommand("UPDATE bg_user SET user_id = @uname, passwd = @pwd, cash = @cash, email = @email WHERE user_code = @uid", sqlcon);
cmd.Prepare();
cmd.Parameters.AddWithvalue("@uname", textBox36.Text);
cmd.Parameters.AddWithvalue("@passwd", textBox37.Text);
// etc etc etc
cmd.ExecuteNonQuery();
This way your strings will get escaped automatically, and its also mysql injection safe for how far thats needed

