Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MySqlConnection DBConnection = new MySqlConnection("server=*;port=3306;username=*;Password=*;Database=*;sslmode=none");
- DBConnection.Open();
- MySqlCommand CMD = new MySqlCommand("select * from Movies order by ID desc limit 3", DBConnection);
- MySqlDataReader Reader = CMD.ExecuteReader();
- while(Reader.Read())
- {
- ID1 = Reader.GetInt32(0);
- ID2 = ID1 - 1;
- ID3 = ID2 - 1;
- ID4 = ID3 - 1;
- Reader.Close();
- for (int i = 1; i <= 3; i++)
- {
- MySqlCommand Post1CMD = new MySqlCommand("select * from Movies where ID =" + i, DBConnection);
- MySqlDataReader PostReader = Post1CMD.ExecuteReader();
- if (PostReader.Read())
- {
- MessageBox.Show(PostReader.GetString(1));
- }
- }
- }
Add Comment
Please, Sign In to add comment