Codeigniter 4 Pagination With Join and Where sql |
(06-23-2022, 10:26 PM)kenjis Wrote:(06-23-2022, 09:55 PM)demyr Wrote: But the thing I face here is the $total variable. It is not usable. Because imagine the total is 6 and I have 3 results per page for 10 results. Then after the second or third pagination it keeps showing the same, the last, item for the rest of the paginations. I believe limit and offset cannot solve the problem since offset creates a starting point until it reaches limit, am I right? says: "return only 10 records, start on record 16 (OFFSET 15)" on w3school You have defined $total as 20, but how can we know it beforehand? With a regular data fetch from $perPage or $total doesn't work. It only works when I call my datas within controller as : PHP Code: $model = new \App\Models\AdminModels\OffersModel(); However, how can I join here with the same column names like fk ? So, whatever I try, the result is not healthy. P.S. edit for the uncceserray spaces in the post |
Welcome Guest, Not a member yet? Register Sign In |