[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:
<?
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;
}
}
?>
Help me plz. need help fast T-T