I am new to Mysql. I have tried to create the stored procedure for server-side pagination. I have tried so many tutorials and StackOverflow answers. But i didn't get the correct output
CREATE PROCEDURE pagination(IN from_date date,IN to_date date,IN limit INT, IN start INT, IN status INT)
BEGIN
SELECT * FROM customer
End
from_date and to_date filter the dob columns
limit is page size(5,10,15)
start is 0 , if page size is 5 start = 5
status value filter the status column(status = 0)
We need the return data in the below format
{
data:[......],
totaldata: 1000
}
total data is total records in the customer table. MySql Versions is 5.6.51