title: PHP PDO::FETCH_ASSOC returns false
body: <p>In this code fetch(PDO::FETCH_ASSOC) retunrs false even if $row>0.<br>
  I couldn't find why this is happening.</p>
  
  <p>Here session is not set as $member is null.</p>
  
  <pre><code>&lt;?php 
  
  $sql = "SELECT * FROM members WHERE username=:decrypted_login and password=:decrypted_pass";
  
  $result = $dbh-&gt;prepare($sql);
  $result-&gt;bindParam(':decrypted_login', $decrypted_login);
  $result-&gt;bindParam(':decrypted_pass', $decrypted_pass);
  $result-&gt;execute();
  $rows = $result-&gt;fetch(PDO::FETCH_NUM);
  
  if($rows &gt; 0)
  {
    $member = $result-&gt;fetch(PDO::FETCH_ASSOC);
    session_regenerate_id();
    $_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
    $_SESSION['SESS_PASSWORD'] = $member['password'];
    $_SESSION['SESS_FIRST_NAME'] = $member['firstname'];
    session_write_close();
  }
  
  ?&gt;
  </code></pre>
  
  <p>I've read many and stackoverflow questions and forums  but couldn't find a solution for this.</p>
  
  <pre><code>var_dump($row); // gives an array   
  
  var_dump($member) //shows bool(false).  
  </code></pre>