title: Outputting more than one User Ban Data using PDO
body: <p>I am trying to display the current users bans. They do display, but it only outputs 1 detail, when I'm trying to <code>fetchAll</code> data for that current user.</p>
  
  <p>Here is my code</p>
  
  <pre><code>function getPlayerBans($username, $conn) {
          $getPlayerBans = $conn-&gt;prepare("SELECT id, player, bannedby, comment, expires, time FROM `bans` WHERE player = :Player");
          $getPlayerBans-&gt;bindValue(":Player", $username);
          $getPlayerBans-&gt;execute();
          $rows = $getPlayerBans-&gt;fetchAll(\PDO::FETCH_ASSOC);
          foreach($rows as $row) {
              $id1 = $row['bannedby'];
              $id2 = $row['comment'];
              $id3 = $row['expires'];
  
          }
          if($getPlayerBans-&gt;rowCount() == 0) 
          {
              echo('No Results Available');
          }else{
          echo "&lt;table id=\"gradient-style\" summary=\"Meeting Results\"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
          &lt;th scope=\"col\"&gt;&lt;b&gt;Banned By&lt;/b&gt;&lt;/th&gt;
          &lt;th scope=\"col\"&gt;&lt;b&gt;Comments&lt;/b&gt;&lt;/th&gt;
          &lt;th scope=\"col\"&gt;&lt;b&gt;Expires&lt;/b&gt;&lt;/th&gt;
          &lt;th scope=\"col\"&gt;&lt;b&gt;Actions&lt;/b&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;tr&gt;
          &lt;th&gt;$id1&lt;/th&gt;
          &lt;th&gt;$id2&lt;/th&gt;
          &lt;th&gt;$id3&lt;/th&gt;
          &lt;th&gt;&lt;img width=\"32px\" height=\"32px\" title=\"Delete\" src=\"/../cp_mod/images/trash_can.png\"&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/tbody&gt;
          &lt;/table&gt;";
  
      }   
  } 
  </code></pre>