Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Pagination Show Rows Info
#1

[eluser]Glazz[/eluser]
Hello,

Don't know if the topic title is correct, but well...

Want i want to know is how to do the math to have something like phpMyAdmin have:
Quote:Showing rows 10 - 19

Using CI Pagination library i don't know how to achieve that =\

- G l a z z
#2

[eluser]Glazz[/eluser]
I'm trying to make it work but no success
This is what i have so far
Code:
$regFinal = $config['per_page'] * $this->uri->segment(2);
        $regInicial = $regFinal - $config['per_page'];
        if ($regInicial == 0):  
            $regInicial++;  
        endif;
        if ($this->uri->segment(2) == $dados['tot_paginas']):  
           $regFinal = $config['total_rows'];  
        endif;    
        if ($this->uri->segment(2) > 1):  
            $regInicial++;  
        endif;
        
        echo $regInicial . ' - ' . $regFinal;
#3

[eluser]Glazz[/eluser]
Thanks, i figured it out!

Code:
$dados['pag_de'] = ($this->uri->segment(2) + 1);
$dados['pag_ate'] = ($config['per_page'] > $config['total_rows']) ? ($this->uri->segment(2) + $config['total_rows']) : ($this->uri->segment(2) + $config['per_page']);




Theme © iAndrew 2016 - Forum software by © MyBB