$offset = $pageSize*($page-1);
$totalRecs = $this->Booking_model->findAllJoinBookingTables("1=1 group by `bookings`.`id`", "COUNT(*) as count");
$totalCount = $totalRecs[0]['count'];
$offset = $pageSize*($page-1);
$totalPages = ceil($totalCount/$pageSize);
$this->db->limit($pageSize,$offset);
i got an Message: Undefined offset: 0 error ..pls help me how to fix it.