• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter Pagination Numbers not correcly displayed in result page

#1
[eluser]Unknown[/eluser]
Codeigniter pagination Numbers not displayed correcly in result page,.

Plz help me. Here i paste in my code.

/*controller page code*/

function search_all()
{
$this->load->view('prd');
$config = array();
$config['base_url'] = base_url().'/product_search/search_all';
$config["total_rows"] = $this->search_product_model->record_count();
$config["per_page"] = 8;
$config["uri_segment"] = 3;

$this->pagination->initialize($config);

$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data["results"] = $this->search_product_model->
get_search($config["per_page"], $page);
$data["links"] = $this->pagination->create_links();

//$this->load->view("example1", $data);
$this->load->view('asd', $data);
}

/*model page code*/

function get_search($limit, $start)
{
$match3 = $this->input->post('search3');
$this->db->like('color',$match3);
$match2 = $this->input->post('search2');
$this->db->like('type',$match2);
$query = $this->db->limit($limit, $start)->get('products');
return $query->result();
}

public function record_count() {
return $this->db->count_all("products");
}

/*view page code*/

foreach($results as $data) {?>
<?php echo $data->id ?>
<?php echo $data->code ?>
<?php
}
?>

<p>&lt;?php echo $links; ?&gt;</p>


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.