i need some help no matter what i am trying it doesnt work.
using codeigniter 2.0.2
i want to set up pagination for my website.
this is what i have in my crontroller:
model:
i need some help in getting to work. it shows the numbers but i click on the numbers it just shows the same results nothing changes.
it shows same results on first page instead of different records. need help fixing that.
btw i read the guide, tried google. followed everything nothing works just shows same page that it shows on the link.
this is the guide i used: http://www.sitepoint.com/pagination-with-codeigniter/
using codeigniter 2.0.2
i want to set up pagination for my website.
this is what i have in my crontroller:
Code:
$config = array();
$config["base_url"] = base_url() . "/credits";
$config['total_rows'] = 200;
$config['per_page'] = 2;
$config["uri_segment"] = 3;
$this->pagination->initialize($config);
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data["results"] = $this->credits_model->
fetch_countries($config["per_page"], $page);
$data["links"] = $this->pagination->create_links();
model:
Code:
public function record_count() {
return $this->db->count_all("sadmin_credits");
}
public function fetch_countries($limit, $start) {
$this->db->limit($limit, $start);
$query = $this->db->get("sadmin_credits");
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
i need some help in getting to work. it shows the numbers but i click on the numbers it just shows the same results nothing changes.
it shows same results on first page instead of different records. need help fixing that.
btw i read the guide, tried google. followed everything nothing works just shows same page that it shows on the link.
this is the guide i used: http://www.sitepoint.com/pagination-with-codeigniter/