Welcome Guest, Not a member yet? Register   Sign In
Pagination not working
#8

[eluser]bhakti.thakkar[/eluser]
I tried the below code which is working but there is only one problem. if for example there are 17 records and if i am setting 15 records per page then on the first page there will be 15 and on the second page instead of remaining 2, it show again 15 i.e. last 2 records + 13 records of previous page. but this is now what is completely ok. below is what i modified in my model.

Project_model.php: where $num is the limit

function _getProjects($offset, $num)
{
$relation_id = $this->session->userdata('srelation_id');

$offset = (!$offset) ? 0 : $offset;
$next = ($num + $offset);
$orderR = "asc";
$where = '';
$sql =
'select * from (' .
'select top ' . $num . ' * from (' .
'select top ' . ($num+$offset-1) . ' * ' .
'from Project_T where Relation_ID = ' .$relation_id.
'order by Project_ID asc) as t1 ' .
'order by Project_ID desc) as t2 ' .
'order by Project_ID asc';
$query = $this->db->query($sql);

return $query->result();

}

Hope i get the final help on it and it also helps some one.


Messages In This Thread
Pagination not working - by El Forum - 11-14-2008, 12:33 AM
Pagination not working - by El Forum - 11-14-2008, 01:24 AM
Pagination not working - by El Forum - 11-14-2008, 01:53 AM
Pagination not working - by El Forum - 11-14-2008, 04:11 AM
Pagination not working - by El Forum - 11-14-2008, 05:41 AM
Pagination not working - by El Forum - 11-15-2008, 05:01 AM
Pagination not working - by El Forum - 11-16-2008, 10:41 PM
Pagination not working - by El Forum - 11-16-2008, 11:23 PM
Pagination not working - by El Forum - 12-02-2008, 01:51 PM
Pagination not working - by El Forum - 12-03-2008, 03:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB