title: count with where clause
body: <p>I've tried putting a where clause in several different places and can't figure this out. I've read questions that have already been asked but no fix so far.  I want the <code>COUNT</code> for <code>items.item_aprv='1'</code> but no matter where I put it I get an error. I've included the entire .php file for reference.</p>
  
  <pre><code>&lt;?php
  
  include 'header1.php';
  ?&gt;
  &lt;div id="templatemo_main"&gt;
  
  &lt;div id="content_full" class="float_r"&gt;
  &lt;br&gt;&lt;h10&gt;Browse Mints&lt;/h10&gt;&lt;br&gt;&lt;br&gt;
  &lt;?php
  
  $search="SELECT mint.*, COUNT(items.item_id) as total
      FROM mint
      LEFT JOIN items ON mint.mint_id=items.item_mint
      GROUP BY mint_id
      ORDER BY `mint_name` ASC ;";
  
  $items=mysql_query($search); 
  while($it=mysql_fetch_array($items)) {
  ?&gt;          
  &lt;div class="mint_box"&gt;
  
  &lt;h10 style="font-size:15px;"&gt;
      &lt;a href="mintitem.php?id=&lt;?php echo $it['mint_id']; ?&gt;"&gt;
          &lt;?php echo $it['mint_name']; ?&gt;
      &lt;/a&gt; (&lt;?php echo $it['total']; ?&gt;)
  &lt;/h10&gt;
  &lt;/div&gt;          
  &lt;?php
  } 
  ?&gt;
  &lt;div class="cleaner h10"&gt;&lt;/div&gt;
  &lt;/div&gt; 
  
  &lt;?php
  include 'footer.php';
  
  ?&gt;
  </code></pre>