Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP
$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.
Posted 13-Mar-12 18:44pm
chopoe463
Edited 13-Mar-12 20:22pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This just means that totalRecs has no value after findAllJoinBookingTables.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 464
1 Sergey Alexandrovich Kryukov 429
2 Maciej Los 285
3 CPallini 180
4 Peter Leow 170
0 Sergey Alexandrovich Kryukov 6,971
1 OriginalGriff 5,532
2 Peter Leow 3,997
3 Mika Wendelius 2,850
4 CHill60 2,808


Advertise | Privacy | Mobile
Web01 | 2.8.150224.1 | Last Updated 14 Mar 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100