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();
}
I'm trying to update both tables, B and Begin to 1 to the current logged in user (my uid command:
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();
}
I don't know why but it doesn't update the database.