mysql - Pagination on select query metamug -
this current resource file. i'm using mysql query pagination feature
<?xml version="1.0" encoding="utf-8" ?> <resource xmlns="http://xml.metamug.net/resource/1.0" v="1.0"> <request method="get"> <query> select * tbl_task_master limit $limit offset $offset </query> </request> </resource>
https://api.metamug.com/checklist/v1.0/task?offset=0&limit=50
it's fetching records. want paginate , subset. how make request metamug.
to implement pagination need make use of limit
, offset
attributes of query
tag , can pass parameter name you'll using in request.
let's pagination parameters l
, o
limit , offset respectively (though not naming convention)
resource
file
update:
<?xml version="1.0" encoding="utf-8" ?> <resource xmlns="http://xml.metamug.net/resource/1.0" v="1.0"> <request method="get"> <param name="l" type="number" required="true" min="5" max="20"/> <param name="o" type="number" required="true" min="0" max="100"/> <query limit="l" offset="o"> select * tbl_task_master </query> </request> </resource>
declaring
<param name="l" type="number" required="true" min="5" max="20"/> <param name="o" type="number" required="true" min="0" max="100"/>
is optional can see can add more constraints initialize them.see more on param
tag , validation
Comments
Post a Comment