Calling data from pagination result - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Calling data from pagination result (/showthread.php?tid=51035) |
Calling data from pagination result - El Forum - 04-18-2012 [eluser]mflammia[/eluser] Hi All, Just wondering what I am doing wrong here. I have the following function in my controller: Code: function databaselist() The output of which is: Code: CI_DB_mysql_result Object Now this is where I am going wrong but from the few places I have read how to configure I should be able to call the data with something like the following: Code: <?PHP foreach($records as $data){ But this is producing a Quote:Message: Trying to get property of non-objecterror. I see its because of the way $result is constructed but I don't know how to call / code getting the right data? Thanks in advance. Calling data from pagination result - El Forum - 04-18-2012 [eluser]Aken[/eluser] You need to use a result method after using get() or similar. See the get() method example here. Calling data from pagination result - El Forum - 04-18-2012 [eluser]mflammia[/eluser] Great! Thanks for the reply, that sorted it. Code: <?PHP foreach($records->result() as $data){ |