title: Parsing Fetch gives Invalid Offset
body: <p>Not sure what is going on here but my password_verify statement is returning an undefined offset.  In the DB password is a required field, it cannot be empty and I've already verified that at least 1 matching row was returned before trying to verify the password against the hash.  When I use a foreach loop before this statement and check the result variable it gives me the hashed password just fine, so I know that there is at least 1 value in the array.  But when I try to access $result[0] that is throwing an undefined offset for some reason.  Tried looking this up but couldn't find relevant information other than the error is simply stating that the array index is invalid, which again is impossible because I can check the result variable with a foreach and see the hashed password in there.</p>
  
  <p>Also a second question I have since I am still learning PDO, when I remove PDO::FETCH_ASSOC from the fetch request I get duplicate entries in my result variable.  Why is that?</p>
  
  <p><strong>Login.php</strong></p>
  
  <pre><code>&lt;?php
      require "conn.php";
  
      $email = $_POST['email'];
      $email = strtolower($email);
      $pass = $_POST['password'];
  
      $stmt = $pdo-&gt;prepare("SELECT password FROM account WHERE email=:email");
      $stmt-&gt;bindParam(":email", $email);
      $stmt-&gt;execute();
      $count = $stmt-&gt;rowCount(); // gets count of records found
  
      if($count &gt; 0) {
          $result = $stmt-&gt;fetch(PDO::FETCH_ASSOC); // gets resultset
          if(!password_verify($pass, $result[0])) {
              echo "2";
          } else
              echo "0";
      }
      else {
          echo "1";
      }
  ?&gt;
  </code></pre>