title: Get all records for user from database
body: <p>In my table 'user_sightings' I allow multiple entries for each user, so it looks as follows...</p>
  
  <pre><code>------------------------
  ID | user_ID | postcode
  1     39       ab12cd
  2     39       sk91ab
  3     39       ab44ix
  </code></pre>
  
  <p>After running my query I try to print out each postcode with the following...</p>
  
  <pre><code>echo $row["postcode"];
  </code></pre>
  
  <p>only this only prints out the first instance for that user, Is their a way I can get all instances for the user and dynamically set them as variables? </p>
  
  <hr>
  
  <p>Query: </p>
  
  <pre><code>$sth = $conn-&gt;prepare("SELECT * FROM directory, user_sightings WHERE directory.user_active != '' AND directory.ID = :uid AND user_sightings.user_ID = :uid");
  $sth-&gt;execute(array(':uid' =&gt; $UID));
  
  while ($row = $sth-&gt;fetch(PDO::FETCH_ASSOC)) {
        echo $row["postcode"];
   }
  </code></pre>