Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 Pagination With Join and Where sql
#11

(06-24-2022, 12:51 AM)kenjis Wrote:
(06-24-2022, 12:28 AM)demyr Wrote: You have defined $total as 20, but how can we know it beforehand?

You can know it by querying the database.

PHP Code:
$total $model->where('offer_status''pending')->countAllResults(); 

Yeah, I know. That's what I tried, you see. We should add such notes to the documentation because there are lots of  beginner level users. (Actually I am working on an official blog project about "how to do x with CodeIgniter". We should clearly write tutorials there. I will ask help here about it soon).

I really wonder if anyone, including you Kenjis, has ever used such data fetching + pagination in real life. So that we will have the real example about it on internet.
Reply


Messages In This Thread
RE: Codeigniter 4 Pagination With Join and Where sql - by demyr - 06-24-2022, 02:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB