Welcome Guest, Not a member yet? Register   Sign In
count all results pagination problem
#1

[eluser]Unknown[/eluser]
Hello everybody,

I have successfully implemented pagination on my site, but when I try to filter the results of my database with some where clauses, the pagination breaks down:
Code:
$this->load->database();

$this->db->where('startingprice >', 0);
$this->db->where('startingprice <', 30);

$this->db->order_by("freeorpaid", "desc");
$this->db->order_by("timeofauction", "asc");
        
$query = $this->db->get("liveauctions", $per_page, $offset);
$num_results = $this->db->count_all_results();

I have included a small snippet. In my view, I get the right records showing up, but still get too many number links in my pagination. I should have three records showing with two records per page, so a total of two pages, but for some reason I still get links to three pages as if the filtering hasnt worked. Any body know what the problem might be?


Messages In This Thread
count all results pagination problem - by El Forum - 06-09-2011, 11:46 AM
count all results pagination problem - by El Forum - 06-11-2011, 10:15 PM
count all results pagination problem - by El Forum - 06-12-2011, 02:31 PM
count all results pagination problem - by El Forum - 06-12-2011, 03:03 PM
count all results pagination problem - by El Forum - 06-13-2011, 05:00 AM
count all results pagination problem - by El Forum - 06-13-2011, 04:28 PM
count all results pagination problem - by El Forum - 06-30-2011, 01:38 PM
count all results pagination problem - by El Forum - 06-30-2011, 05:14 PM
count all results pagination problem - by El Forum - 07-08-2011, 01:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB