title: I have a problem while selecting all rows in MySQL
body: <p>I am very new to PHP and I'm trying to make a Log-In system with MySQL. I have a form where the user registers and it saves in a database table called registers. I already have the Log-In verify and all those things. When only one user is registered, it works perfectly. But when another user registers, the SELECT thing only selects the first ro (first user's pw), so the second user can't log-in because the SELECT doesn't include all the table's rows. Here is my code:</p>
  
  <p>include 'cn.php';</p>
  
  <pre><code>    if ($_SERVER["REQUEST_METHOD"] == "POST") {
  
          $user = htmlspecialchars($_REQUEST["user"]);
          $u_password = htmlspecialchars($_REQUEST["password"]);
          $qry = "SELECT user, password FROM registers";
          $result = mysqli_query($conexion, $qry);
          $row = mysqli_fetch_array($result);
  
          $db_user = $row["user"];
          $db_password = password_verify($u_password, $row["password"]);
  
          if($u_password == $db_password) {
              echo "&lt;script&gt;alert('You are in')&lt;/script&gt;";
          } else {
              echo "&lt;script&gt;alert('Error')&lt;/script&gt;";
          }
  
      }
  </code></pre>
  
  <p>My question is: How can I select ALL the rows inside registers, since select only detects the first row, that in this case is the first user registered?</p>