title: simple else with while in loop not working
body: <p>My code is working as for my needs. But the only thing bugging me is
   the "else" is not working. When i search for a correct record the
   record will appear and it was running fine. But if i Incorrectly
   search a record nothing will happen. i am expecting "Records not Found" will echo but nothing happen.</p>
  
  <hr>
  
  <pre><code>}else{
         echo "Records not found";
      }
  </code></pre>
  
  <hr>
  
  <p>This is the whole code.</p>
  
  <pre><code>      &lt;?php
  $conn = mysqli_connect("localhost", "root", "", "my1stdb") or die("could not connect");
  
  $set = $_POST['search'];
  
  
  if ($set) {
      $show   = "SELECT * FROM users where email='$set'";
      $result = mysqli_query($conn, $show);
      while ($rows = mysqli_fetch_array($result)) {
          echo "Registrant Found";
          echo "&lt;tr&gt;";
          echo "&lt;td&gt;";
          echo $rows['username'];
          echo "&lt;/td&gt;";
          echo "&lt;td&gt;";
          echo $rows['fullname'];
          echo "&lt;/td&gt;";
          echo "&lt;td&gt;";
          echo $rows['password'];
          echo "&lt;/td&gt;";
          echo "&lt;td&gt;";
          echo $rows['email'];
          echo "&lt;/td&gt;";
          echo "&lt;/tr&gt;";
          echo "&lt;br/&gt;";
      }
  
  } else {
      echo "Records not found";
  }
  
  ?&gt;
  &lt;/table&gt;
  </code></pre>