0

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

Andrew Morton
  • 24,203
  • 9
  • 60
  • 84
Murugan
  • 95
  • 2
  • 12
  • Python Flask REST API – Murugan Dec 10 '21 at 10:44
  • 1
    I added the "python" and "flask-restful" tags to your question for you, but if the latter is wrong then please [edit] it. – Andrew Morton Dec 10 '21 at 10:55
  • 1) You might find some of the answers to [Pagination using MySQL LIMIT, OFFSET](https://stackoverflow.com/q/20364349/1115360) useful. (PHP uses `.` for string concatenation instead of `+`.) 2) It would be helpful if you edited your question to also show the code which calls the stored procedure. – Andrew Morton Dec 10 '21 at 12:03

0 Answers0