title: While loop and function return with PDO
body: <p>I want to use 'return' function with a while loop for my Mysql query, but it returns only one result. <BR>
  I have this in my database :</p>
  
  <pre><code>id  name   author
  1   foo    fooo
  2   foo2   fooo2
  </code></pre>
  
  <p><strong>It returns only "2", but i want "1","2","3" ect..<br>
  Here's my code :<br></strong></p>
  
  <pre><code>function get_thm_cat() {
  require 'database.php';
  $req = $bdd-&gt;prepare("SELECT * FROM sk_cat ORDER BY id ASC");
  $req-&gt;execute();
  if ($req-&gt;rowCount() &gt; 0) {
  while ($row = $req-&gt;fetch()) {
  return '&lt;ul id="ul_cat"&gt;&lt;li id="li_cat"&gt;'.$row["id"].'&amp;nbsp; Name = '.$row["name"].'&lt;br&gt;';
  } 
  } 
  $req-&gt;closeCursor(); 
  }
  </code></pre>