I am trying to create pagination in codeigniter and I have work, but I have a little problem. It seems to load all the records in my database, not the selected ones that I want.
public function original_count() { $this->db->where('type', 'Original'); return $this->db->count_all("story_tbl"); }
I know that what happens is that the last line redefines my previous statements. I can't seem to find a way around it. I tried just staight sql statement and then returned it, but I could not get this to work.
that was my expression ...
SELECT COUNT(*) FROM story_tbl where type = 'Original';
Some help would be greatly appreciated! :)
source share