Raw Query Pagination |
Dear All,
how to create pagination in CI4 using raw query? my model: Code: public function getData() Code: $curentPage = 1; 'get_all_data' is a mysql view that i create in database. so i want show data in CI4 view with pagination. best regards
10-30-2021, 02:45 AM
(This post was last modified: 10-30-2021, 02:46 AM by captain-sensible. Edit Reason: added something i forgot )
whats the advantage of that when you are using "*" which gets all.
in a model you define fields: Code: class BlogModel extends Model via a Controller you can get a handle to Model eg Code: $handle = new BlogModel(); Code: foreach($blogs as $blogy) the main point being you can get access to all field in the table. So basically (i think) 'blogs' => $handle->paginate(5) is saying blogs is an object which contains data in all fields that were listed in my model i.e "*" and that blogs is passed to view bundled in $data
(10-30-2021, 02:45 AM)captain-sensible Wrote: whats the advantage of that when you are using "*" which gets all. Thank you for reply. My question how to paging from raw CI4 query result. if using the model i have no problem with that. Already used that. i want show all data from mysql view. |
Welcome Guest, Not a member yet? Register Sign In |