i use of codeigniter
Why not work $this->pagination->create_links()
in my code?
Problem 1: I have this error:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: offset
Filename: admin/accommodation.php
Line Number: 45
Problem 2: After click on $this->pagination->create_links()
, change url, but does not change content table.i use of XAMPP
What do i do?
my code:
function show()
{
// load pagination class
$this->load->library('pagination');
$config['base_url'] = base_url().'admin/accommodation/show';
$config['total_rows'] = $this->db->count_all('hotel_submits');
$config['per_page'] = '2';
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$offset = (int) $offset; // just to make sure nothing funky gets in here
$data['results'] = $this->db->query("SELECT @rownum:=@rownum+1 rownum, t.* ".
"FROM (SELECT @rownum:=0) r, hotel_submits t ".
"ORDER BY id desc LIMIT $offset, 2");
$this->load->view('admin/accommodation_submit_show', $data);
}
With respect