![]() |
Another pagination issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Another pagination issue (/showthread.php?tid=25495) |
Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] All Having my first go at the pagination class but doesnt display anything at all on my page in my controller i have Code: private $limit = 3; And i call it in my view as follows Code: <?php echo $pagination; ?> This seems to mirror what i ve been researching but doesnt return any results Any ideas Thanks Gibbo Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] Heres my view Code: <html> Another pagination issue - El Forum - 12-14-2009 [eluser]saidai jagan[/eluser] u printed the number of records in the table.? Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] i thought id covered everything, how do i print the number of records in the table Another pagination issue - El Forum - 12-14-2009 [eluser]saidai jagan[/eluser] echo $config['total_rows'] = $this->books_model->getall(); Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] Doh, ok that was a silly error, wasnt counting in the getall function, i ve now set that up and the pagination counts properly and returns what i would expect, however, its not linked into my table though and im not sure why, appologies if im asking daft questions, i am trying to figure this out myself but not getting very far at the moment, my code is still as above Gibbo Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] Sorry should have posted the rest of my controller function Code: function main($offset = 0){ Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] OK, getting a bit nearer i think, in my model i ve changed my get all function to get records as follows Code: function get_books($num, $offset) { then from my controller i try to call it as follows Code: $data['query'] = $this->books_model->get_books($config['per_page'],$this->uri->segment(4)); now i get an error stating A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: views/books_main.php Line Number: 45 any ideas please Gibbo Another pagination issue - El Forum - 12-14-2009 [eluser]gibbo1715[/eluser] Ignore that, got it working, forgot return $query->result(); in my get_books function ![]() Thanks Gibbo Another pagination issue - El Forum - 12-14-2009 [eluser]saidai jagan[/eluser] Code: function get_books($num, $offset) |