Welcome Guest, Not a member yet? Register   Sign In
builder question when using pagination
#1

I created a builder object and if I use the where function to restrict results, how do I get the total records for pagination links?

I seem to have to create two builder objects

Code:
$builder = $this->db->table('searchlogs');
$builder2 = $this->db->table('searchlogs');

$builder->where('id' > 5);
$builder2->where('id' > 5);
$result = $builder->get(5,10);
$total = $builder2->countAllResults();

I cannot use countAllResults with $builder as this kills the filter returned.
Reply


Messages In This Thread
builder question when using pagination - by frocco - 09-28-2022, 08:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB