title: Count on Zend_Db_Select
body: <p>Say I have a random zend_db_select object.</p>
  
  <p>How can I perform a count on that object, so I know the amount of items that meet the query.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>$data-&gt;TotalRecords = $select-&gt;columns(new Zend_Db_Expr('COUNT(*)'))-&gt;query()-&gt;fetch();
  </code></pre>
  
  <p>But this gives me the following error:</p>
  
  <blockquote>
    <p>Message: No table has been specifiedfor the FROM clause</p>
  </blockquote>
  
  <p>The query by itself works fine and returns a resultset.</p>