title: PHP : select multiple count(id) from MySQL as one query
body: <p>I need to optimize the following code in one query :</p>
  
  <pre><code>        $query = 'select count(id) as featured_ads from #___properties  WHERE featured = 1 and approved =1';
      $db-&gt;setQuery($query);
      $featured_ads = intval($db-&gt;loadResult());
  
  
      $query = 'select count(id) as wait_ads from #___properties  WHERE approved =0 and canceled&lt;&gt;"1" ';
      $db-&gt;setQuery($query);
      $wait_ads = intval($db-&gt;loadResult());
  
  
      $query = 'select count(id) as total_users from #__sresuad WHERE gid = 18 ';
      $db-&gt;setQuery($query);
      $total_users = intval($db-&gt;loadResult());
  </code></pre>
  
  <p>What should I do?</p>