title: PHP Array Duplicates
body: <p>my first post here and hoping someone can help. I am querying a table in a mySQL DB, and obviously getting the results. However, the table is used to store multiple entry by one user for the purpose of user contacts.</p>
  
  <p>What I would like to do is display each user individually, and count the number of contacts each user has. I had a look at the post "How to detect duplicate posts in PHP array, which helped a bit, but I am still stuck. </p>
  
  <p>Please see my code for the query below, I have left out the array duplicate part as it is a pretty mess at the moment. </p>
  
  <pre><code>&lt;?php
      $result = mysql_query("SELECT * FROM vines");
      while($row = mysql_fetch_array($result)) {
          $results=$row['vinename'];
          echo $results;
          echo "&lt;br /&gt;";
      }
  ?&gt;
  </code></pre>
  
  <p>This result returns the below, obviously these are records from the vinename coloumn.</p>
  
  <pre><code>Marks Vine&lt;br /&gt;
  Marks Vine&lt;br /&gt;
  Marks Vine&lt;br /&gt;
  Tasch Vine&lt;br /&gt;
  Tasch Vine&lt;br /&gt;
  </code></pre>
  
  <p>Regards
  Mark Loxton</p>