Welcome Guest, Not a member yet? Register   Sign In
problem with pagination
#1

(This post was last modified: 08-29-2017, 04:25 AM by programmer.)

i use pagination in codeigniter . and show page number but dosn't show previous and next button


controller code

PHP Code:
$config['base_url'   base_url() . 'track/category/' $title '/page/';
                    
$config['total_rows' $this->custom_model->GetcountDataByCategory('track'$id);
                    
$config['per_page']       30;
                    
$config['uri_segment'] = $this->uri->segment(5);
                    
$page                  = ($this->uri->segment(5)) ? $this->uri->segment(5) : 0;                    
                    
$this->pagination->initialize($config);
                    
$data['pagination'   $this->pagination->create_links();                    
                    
$tracks                $this->track_model->getDataByPaging($id$config['per_page'], $page); 

model code : 
PHP Code:
public function getDataByPaging($id$limit$start){
        
$publishDate strtotime(date('d F Y h:i A'));
 
       $this->db->select('t.id  tid,t.artist_id  tartistid,t.remixer tremixer,t.genre_id  tgenrei,t.category_id tcategory,t.title  ttitle,t.cover  tcover,t.energy,t.label,t.on_sale tonsale,t.featured,t.description,t.publish_date,t.release_date,t.count_download,t.key,t.bpm,t.url,t.lik,artists.id,artists.artist_name,g.id gid,g.name,cat.id catId,cat.title catTitle,');
 
       $this->db->from('track AS t');
 
       $this->db->join('artists','artists.id = t.artist_id');
 
       $this->db->join('genres AS g','g.id = t.genre_id');
 
       $this->db->join('category AS cat',"cat.id = t.category_id");
 
       $where "t.publish_date = 'NULL' OR t.publish_date <= $publishDate AND t.category_id = $id";
 
       $this->db->where($where);
 
       $this->db->order_by('t.release_date','desc');
        
$this->db->limit($limit$start);
 
       $query $this->db->get();
 
       return $query->result();


here
Reply


Messages In This Thread
problem with pagination - by programmer - 08-29-2017, 04:23 AM
RE: problem with pagination - by InsiteFX - 08-30-2017, 02:23 AM
RE: problem with pagination - by programmer - 08-30-2017, 03:09 AM
RE: problem with pagination - by sasbass - 08-31-2017, 01:51 AM
RE: problem with pagination - by InsiteFX - 08-31-2017, 02:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB