Codeigniter count_all for pagination


work on count_all condition.. you can use below method to find out total number of rows..


public function count_all() {
    $this->db->select ( 'COUNT(*) AS `numrows`' );
    $this->db->where ( array (
            'type' => 'Original'
    ) );
    $query = $this->db->get ( 'story_tbl' );
    return $query->row ()->numrows;
}

ou could also use the built-in num_rows() function...
$query = $this->db->where('type', 'original')->get('story_tbl');
return $query->num_rows();