Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. Function total_count {
  2. $this->db->select('user_id, COUNT(user_id) as total');
  3. $this->db->group_by('user_id');
  4. $this->db->order_by('total', 'desc');
  5. $this->db->get('tablename', 10);
  6. }
  7.  
  8. $data = array (
  9. 'totalcount' => $this->mymodel->total_count(),
  10. );
  11.  
  12. Echo $totalcount
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement