title: How to count total no of records based on value using codiegniter
body: <pre><code>  id | name | status
  
     1 |  name | yes
  
     2 |  name | no 
  
     3 |  name | yes
  </code></pre>
  
  <p>How i can count total status with value yes and with value no using active records ? Like count is : <strong>yes = 2</strong> , <strong>no = 1</strong></p>
  
  <p>This is what i have tried so far</p>
  
  <pre><code>$this-&gt;db-&gt;select('count(status));
  //$this-&gt;db-&gt;select('count(where status == 'yes')); // not working
  $query = $this-&gt;db-&gt;get();
  </code></pre>