Welcome Guest, Not a member yet? Register   Sign In
undefined table data, pagination related
#1

[eluser]zgames[/eluser]
I'm trying to get users only with gender M, however pagination is trying to get all the values, therefore when the value is not equal it gives me this error, other wise everything is working perfectly fine


could someone give me advice how to solve this problem?


my model
Code:
function list_all(){
  $this->db->order_by('id','asc');
  return $this->db->get($tbl_person);
}

function count_all(){
  return $this->db->count_all($this->tbl_person);
}

function get_paged_list($gender,$limit = 10, $offset = 0){
  $this->db->order_by('id','asc');
  return $this->db->get_where($this->tbl_person,array("gender" => $gender), $limit, $offset);
}

my controller
Code:
$puslapiai = $this->Puslapiai_model->get_paged_list('M', $this->limit, $offset)->result();
  
  // generate pagination
  $this->load->library('pagination');
  $config['base_url'] = site_url('puslapiai/index/');
   $config['total_rows'] = $this->Puslapiai_model->count_all();
   $config['per_page'] = $this->limit;
  $config['uri_segment'] = $uri_segment;
  $this->pagination->initialize($config);
  $data['pagination'] = $this->pagination->create_links();
  
  // generate table data
  $this->load->library('table');


Messages In This Thread
undefined table data, pagination related - by El Forum - 05-29-2012, 03:37 AM
undefined table data, pagination related - by El Forum - 05-29-2012, 08:26 PM
undefined table data, pagination related - by El Forum - 05-29-2012, 08:55 PM
undefined table data, pagination related - by El Forum - 05-29-2012, 10:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB