Codeigniter pagination not showing first row of query result Codeigniter pagination not showing first row of query result codeigniter codeigniter

Codeigniter pagination not showing first row of query result


return $query->num_rows; should be return $query->num_rows();.

Also, try changing LIMIT $limit OFFSET $offset to LIMIT $offset,$limit.


$this->uri->segment(3, 0);

By default the function returns FALSE (boolean) if the segment does not exist. so i think isn't right!?

($offset      === NULL) ? ($offset = 0) : ($offset = $offset);


Problem is, when default page execute it start record from 1st row instead zero, that's why first row is missing. I applied following code to fix this problem

$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;

Please edit segment as per your request URL