@bobbybouwmann
ok, the first query counts
but look this example:
I want a pagination of 2 items per page and i have tables like this:
Users table:
| id | name | active | banned | type |
| --- | --- | --- | --- | --- |
| 1 | Joe | 0 | 1 | guest |
| 2 | Bobby | 1 | 0 | basic |
| 3 | Omar | 0 | 1 | guest |
Data table:
| id | user_id | first |
| --- | -------- | -------- |
| 1 | 1 | 1 |
| 2 | 2 | 1 |
| 3 | 3 | 0 |
So the second query gets all the data table and ordered by first column and limit 2, and give me the first 2 records in data table.
| id | user_id | first |
| --- | -------- | ------- |
| 1 | 1 | 1 |
| 2 | 2 | 1 |
then the 3 query:
select * from users where users.id in (1, 2) and active = 1 and banned = 0 and type = basic
the result is:
| id | name | active | banned | type |
| --- | -------- | -------- | ---------- | ------ |
| 2 | Bobby | 1 | 0 | basic |
The result is only 1 row, but my pagination is 2.
How can I achieve always get the specified items per page?