Next link in codeigniter not working properly?

    	public function category($id){
    
    $q = $this->db->get('app_categories');
   	$data['result'] =  $q->result();
  
        $query = $this->db->get_where('app_questions',['cat_id'=>$id]);
    
      $numrows=$query->num_rows();
    
     $config['base_url'] = 'http://demosite.com/index.php/newapps/category/'.$id.'/';
     
     $config['total_rows'] = $numrows;
     
     $config['per_page'] = 5;

  $page  =  $this->uri->segment(4,0);
     
     $uery= $this->db->get_where('app_questions',['cat_id'=>$id],$config['per_page'],$page);
     
 $uery->num_rows();
     
     $data['molly']=$uery->result();
     
     $this->pagination->initialize($config);

  $data['links']= $this->pagination->create_links();
     $data['menu'] = 'aptitude';
       $this->load->view('frontend/partials/css');
      $this->load->view('frontend/partials/header',$data);
      $this->load->view('frontend/myview/newapps',$data);
      $this->load->view('frontend/partials/footer');
    
    
  
}

What does “not working properly?” mean? What does it do that it should not, or what does it not do that it should?

2 Likes

What is $uery? Perhaps you meant $query? This shows up twice in your code.

I wondered about that, but figured it was just an alternative to using $query2 or some other meaningless name. This line in isolation, though

$uery->num_rows();

seems strange, I don’t know Codeigniter but the previous usage suggests the line should assign it to something.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.