Help! with pagination!! - 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: Help! with pagination!! (/showthread.php?tid=43544) |
Help! with pagination!! - El Forum - 07-15-2011 [eluser]Unknown[/eluser] In controller I have this function which listing data from data base and also contains pagination. when I am removing the pagination code its working fine. Code: public function makeManagement($passed_data=NULL) when I am calling this above function from another function that is saving data to data base then its fine, Here is the add function in controller. Code: public function addMakeProcess() but when I call function "makeManagement($data)" (the first one) from another function namely deleteMake(); then I get an error that is: A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/make_management.php Line Number: 49 Here is the deleteMake() function code: Code: public function deleteMake($make_id=NULL) Here is the model code for deleting: Code: function remove_make($id) Here is the model code for lsitng recodrs: Code: function get_make($perPage, $uri) What is wrong with this please help I am really stuck with this. Thanks in advance Help! with pagination!! - El Forum - 07-16-2011 [eluser]Aken[/eluser] You're trying to loop through an array in your "views/make_management.php" view file, but it is not reaching the view as an array, but something else. Find where that array is supposed to come from, then find out why it isn't an array at all. Help! with pagination!! - El Forum - 07-20-2011 [eluser]Unknown[/eluser] I have got the point I was sending wrong argument to the model I come up with two changes in the controller and it solved my problem.... thought that might be helpful for others... Here goes the two changes that I made to the function in controller that contain the pagination. Code: public function makeManagement($passed_data=NULL,$page=NULL) |