How to get the records for the second page with server side processing
How to get the records for the second page with server side processing
Hi,
I am sorry if there is an answer for this already, but I am searching for hours with no success.
I am using serverside processing, I don't understand how do I get the records from my MySql database for the second page with the 'iDisplayStart' parameter.
The records I get for the second page are the same as the ones I get on the first page.
If I limit the records, in my sql query like so: select * from table limit 10 offset 10, the first time the page loads
the second page button does not appear (because of course, I fetched only 10 records).
As far as I know I can't do an offset on a table without a limit, so I am very confused here.
Can someone please help me with that?
Answers
I tried using the Draw parameter, but I am not getting any Draw parameter from the client side. Tried to set it to the value I'm getting from 'iDisplayStart', didn't help.
I see another problem now:
When I load the page, under the table I see:
Showing 1 to 10 of 11 entries
But the table has 11 entries in it and not 10.
I tried to hard code the values returned like this:
Bottom Line: Showing 1 to 10 of 10 entries (filtered from 11 total entries)
Rows in first page of the table: 11 (not 10)