title: How to get all rows with group by with codeigniter
body: <p>I have a table to manage the votes for a list of videos and I need to get how much votes the single entry have.</p>
  
  <p>This is my table:</p>
  
  <pre><code>id | user_id | entry_id | vote
  </code></pre>
  
  <p>And this an example of entries:</p>
  
  <pre><code>1  |    1  |    729  |  3  
  2  |    2  |    729  |  4  
  3  |    3  |    729  |  4  
  4  |    4  |    729  |  1  
  5  |    5  |    729  |  4
  </code></pre>
  
  <p>I need to get how much users vote 1, 3 and 4 and the total users that voted that entry.</p>
  
  <p>In this case I shoud get:</p>
  
  <pre><code>Users that voted 1: 1  
  Users that voted 3: 1  
  Users that voted 4: 3  
  Total user: 5
  </code></pre>
  
  <p>In this case I can create the percent with php.</p>
  
  <p>This is what I did with active records:</p>
  
  <pre><code>$this-&gt;db-&gt;select('COUNT(*) as tot_users, vote', FALSE);
  $this-&gt;db-&gt;from('voti_video');
  $this-&gt;db-&gt;where('entry_id', $id_entry);
  $this-&gt;db-&gt;group_by('vote');
  </code></pre>
  
  <p>With this code I get exactly what users voted and how many of them voted.<br>
  How can I now get the total numbers of users without make a new query?<br>
  Is it possibile?</p>