title: selecting unique values from a column
body: <p>I have a MySQL table which contains the following type of information:</p>
  
  <pre><code>    Date            product 
  2011-12-12           azd
  2011-12-12           yxm
  2011-12-10           sdx
  2011-12-10           ssdd  
  </code></pre>
  
  <p>Here is an example of a script I use to get data from this table:</p>
  
  <pre><code>&lt;?php
  
  $con = mysql_connect("localhost","username","password");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  mysql_select_db("db", $con);
  $sql=mysql_query("SELECT * FROM buy ORDER BY Date");
  while($row = mysql_fetch_array($sql))
  {
  
   echo "&lt;li&gt;&lt;a href='http://www.website/". $row['Date'].".html'&gt;buy ". date("j, M Y", strtotime($row["Date"]))."&lt;/a&gt;&lt;/li&gt;";
  
      }
      mysql_close($con);
  ?&gt; 
  </code></pre>
  
  <p>This script displays every date from the table, e.g.</p>
  
  <pre><code>12.dec 2011
  12.dec.2011
  10.dec.2011
  10.dec.2011
  </code></pre>
  
  <p>I would like to only display unique dates, e.g.</p>
  
  <pre><code>12.dec.2011
  10.dec.2011
  </code></pre>