title: Checking the count in a while loop constantly throws messagebox when it shouldnt
body: <p><strong>Goal:</strong></p>
  
  <p>I am aiming to notify the user then a new record is detected in MySQL table.</p>
  
  <p><strong>What I am using:</strong></p>
  
  <p>I am using <code>Windows form</code> and <code>MySQL</code>.</p>
  
  <p>Also, within the code I am using <code>"SELECT COUNT(*)"</code> and store it into a variable to check the previous count and the new count.</p>
  
  <p><strong>What I currently have coded:</strong></p>
  
  <pre><code>  public Dashboard()
      {
          InitializeComponent();
  
          //Timer to run function every 10 seconds
          System.Timers.Timer timer = new System.Timers.Timer();
          timer.Interval = 10000;
          timer.Elapsed += Notification;
          timer.Start();
      }
  
      //Track changes in MySQL table - and if new records appear then notify the user
      private void Notification(object sender, System.Timers.ElapsedEventArgs e)
      {
          //MySQL connection
          using(var conn = new MySqlConnection(ConnectionString.ConnString))
          {
              conn.Open();
              //Create command
              using(var cmd = new MySqlCommand("SELECT COUNT(*) from tester", conn))
              {
                  var dr = cmd.ExecuteReader();
  
                  while (dr.Read())
                  {
                      //Current Number
                      int count = dr.GetInt32(0);
  
                      //Previous number
                      int prev_numb = int.MinValue;
  
                      while (true)
                      {
                          //If count is not same as previous number
                          if(count != prev_numb)
                          {
                              //Notify user
                              MessageBox.Show("New Record!");
                              //Set prev_numb to new numb
                              prev_numb = count;
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>The first part of the code works fine (Runs the function every 10 seconds).</p>
  
  <p>But the messagbox keeps prompting every 10 seconds, even if the <code>count</code> has not changed... why is this happening? And what needs amending within the code to work as desired?</p>
  
  <p><strong>Resources:</strong></p>
  
  <p>Repeat function every n minutes
  <a href="https://stackoverflow.com/a/34204679/12485722">https://stackoverflow.com/a/34204679/12485722</a></p>
  
  <p>Loop:
  <a href="https://stackoverflow.com/a/13051703/12485722">https://stackoverflow.com/a/13051703/12485722</a></p>