using (MySqlCommand bb = new MySqlCommand("UPDATE members SET Begin = 1 WHERE id ='" + uid + "';"))
{
bb.Connection = con;
con.Open();
using (MySqlCommand fff = new MySqlCommand("UPDATE members SET b = 1 WHERE id ='" + uid + "';"))
{
fff.Connection = con;
}
this.Hide();
Main main = new Main();
main.Show();
}
我正在尝试将两个表 B 和 Begin to 1 更新为当前登录的用户(我的 uid 命令:
using (MySqlCommand id = new MySqlCommand("SELECT id FROM members WHERE username='" + textBox1.Text + "';"))
{
id.Connection = con;
MySqlDataReader read3 = cmd.ExecuteReader();
read3.Dispose();
int idd = (int)id.ExecuteScalar();
uid = idd;
Begin.uid = idd;
MySqlDataReader read4 = id.ExecuteReader();
read4.Dispose();
id.Dispose();
}
我不知道为什么,但它不会更新数据库。