title: php PDO fetchAll() - while not working, foreach works
body: <p>I would like to know if i'm doing fine OR fetchAll() doesn't work with WHILE.</p>
  
  <p>here is an exemple</p>
  
  <pre><code>$db=new PDO("mysql:host=" .$dbhost. "; dbname=" . $dbname, $dbuser, $dbpass);
  
  $page=$db-&gt;prepare("SELECT * FROM page");
  $page-&gt;execute();
  
  foreach ($page-&gt;fetchAll(PDO::FETCH_ASSOC) as $row) {
  
  //echo a row
  //is working
  }
  </code></pre>
  
  <p>however, i if try looping with a while</p>
  
  <pre><code>while ($row=$page-&gt;fetchAll(PDO::FETCH_ASSOC)){
  
  //echo a row
  //Show empty
  }
  </code></pre>
  
  <p>i tryed to use only fetch(), it was working, my question: why fetchAll() doesn't work with "WHILE" ?</p>