title: Select YEAR from mysql (pagination)
body: <p>I have a mysql table with records dating from 2006 to present (and ongoing), all with datetime stamps</p>
  
  <p>What is the smartest/easiest way to extract all YEARS only and make a pagination link for each year (dynamically)?
  Like this: 2006 2007 2008 2009 2010 2011 2012</p>
  
  <p>Isn't this too clumsy and uses too many resources for that simple task?:</p>
  
  <pre><code>@mysql_query("SELECT YEAR(date) AS yearonly FROM table GROUP BY yearonly");
  </code></pre>