CodeIgniter Forums
Pagination different between localhost and webs - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pagination different between localhost and webs (/showthread.php?tid=8919)



Pagination different between localhost and webs - El Forum - 06-05-2008

[eluser]RaiNnTeaRs[/eluser]
Hi all, I;m having difficulties in creating pagination.I'm using the same command in my localhost and my websites( just changing the baseurl's) and its not working. Here is my code :
Code:
$config['base_url']='http://www.rnbtaekwon.com/index.php/dojang/news/';
            
            $config['total_rows']=$this->db->count_all('tabel_news');
            $config['per_page']='5';

            $this->pagination->initialize($config);
            $this->load->model('mpagination');
            $data['hasil'] = $this->mpagination->get_data('tabel_news',$config['per_page'],$this->uri->segment(3));

            $tmpl = array ( 'table_open'  => '<table border="2" cellpadding="2" cellspacing="2" class="mytable">' );
            $this->table->set_template($tmpl);

my models filename is mpagination.php
Code:
&lt;?
class mpagination extends Model
{
    function mpagination()    {
        parent::Model();
    }
    function get_data($tab,$num,$offset)    {
    
        $this->db->select('news,tanggal,sender');
        $this->db->from($tab);
        $this->db->orderby("tanggal","asc");
                
        $query = $this->db->get($tab, $num, $offset);
        return $query;
    }
}
?&gt;
Help me plz. need help fast T-T


Pagination different between localhost and webs - El Forum - 06-05-2008

[eluser]RaiNnTeaRs[/eluser]
BTW, im using PHP 4 as my compiler .thx


Pagination different between localhost and webs - El Forum - 06-05-2008

[eluser]ontguy[/eluser]
what does the output of
Code:
echo $this->pagination->create_links();
look like in the view?