title: Regarding the while loop in the login.php
body: <p>I have a question, after using this stack post to solve a password_verify issue: <a href="https://stackoverflow.com/q/31362516/5701216">How to use password_verify function in PHP</a></p>
  
  <p>Say I have this login form:</p>
  
  <pre><code>&lt;?php
      session_start();
      if ($_SERVER['REQUEST_METHOD'] == 'GET') { ?&gt;
          &lt;form id="signin_frm" name="signinFrm" action="&lt;?php echo htmlentities($_SERVER['SCRIPT_NAME']) ?&gt;" method="post"&gt;
              &lt;label class="label-first" for="email"&gt;Email&lt;/label&gt;
              &lt;input id="email" type="email" name="login_email" placeholder="Someone@example.com" required&gt;
              &lt;label for="pswd"&gt;Password&lt;/label&gt;
              &lt;input id="pswd" type="password" name="login_password" placeholder="Password" required&gt;
              &lt;fieldset&gt;
                  &lt;input class="btn" type="submit" value="Sign-Up"&gt;
              &lt;/fieldset&gt;
          &lt;/form&gt;
  &lt;?php } else {
      $email = $_POST['login_email'];
      $password = $_POST['login_password'];
      $find_pswd = "SELECT password FROM UserLogin WHERE email = '$email';";
      $query = mysqli_query($link, $find_pswd);
  
      while ($row = mysqli_fetch_array($query)) {
          $user_pass = $row['password'];
          $verify_pass = password_verify($password, $user_pass);
      }
  
      if ($verify_pass === false) {
          echo "Invalid Password";
      }
  
      mysqli_free_result($query);
  }
  ?&gt;
  </code></pre>
  
  <p>If, through the mysql query, I am already retrieving a singular value from the table, why is it necessary to use the While Loop in order for password verification to work (verify_password() returning true)? Is there not a simpler way of doing this?</p>
  
  <p>Prior to implementing the while loop, I had this:</p>
  
  <pre><code>&lt;?php } else {
          $email = $_POST['login_email'];
          $password = $_POST['login_password'];
          $find_pswd = "SELECT password FROM UserLogin WHERE email = '$email';";
          $query = mysqli_query($link, $find_pswd);
          $pswd_fetch = mysqli_fetch_array($query);
          if (password_verify($password, $pswd_fetch) === false) {
              echo "Invalid Password";
          }
  
          mysqli_free_result($query);
      }
  ?&gt;
  </code></pre>
  
  <p>Thank you! Aside from this question, feel free to provide any other suggestions in improving this code. I am looking to keep the login fairly simple, as I am only providing the user means to editing information that is not highly sensitive.</p>
  
  <p>NOTE: The password in the database is hashed (BCrypt). Thanks to those who mentioned hashing!</p>