title: how to write this query using DATE_FORMAT using Zend Framework?
body: <p>Basically, I want a news page with Archives list in the side column based on the month and year.. for example June 2012. The table is named 'news', with columns news_id, news_title, news_entry, updated, created. Updated and created are timestamps. Right now I am using normal php  as below: </p>
  
  <pre><code>mysql_select_db($database_admin_conn, $admin_conn);
  $query_getArchives = "SELECT DISTINCT DATE_FORMAT (news.updated, '%M %Y') AS archive, DATE_FORMAT (news.updated, '%Y-%m') AS link FROM news ORDER BY news.updated DESC";
  $getArchives = mysql_query($query_getArchives, $admin_conn) or die(mysql_error());
  $row_getArchives = mysql_fetch_assoc($getArchives);
  $totalRows_getArchives = mysql_num_rows($getArchives);
  </code></pre>
  
  <p>Code to display archives column is as below: </p>
  
  <pre><code>&lt;h3&gt;News Archives&lt;/h3&gt;
  &lt;ul&gt;
  &lt;?php do { ?&gt;
  &lt;li class="seperator
  &lt;?php echo (isset($_GET['archive']) &amp;&amp; $_GET['archive'] == $row_getArchives['link'] ? 'currentItem' : '') ?&gt;"&gt;
  &lt;a href="news.php?archive=&lt;?php echo $row_getArchives['link']; ?&gt;"&gt;&lt;?php echo $row_getArchives['archive']; ?&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;?php } while ($row_getArchives = mysql_fetch_assoc($getArchives)); ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How do I realise the select statement in the first block of code in Zend Framework, to achieve the same result as the present code output? Thanks in advance! </p>