I am creating API in php for android project. where I need to Create Product items API that gives first 10 records when request method pass 0 value, and gives 10 records more when value is 1. Thus API gives 0-10,11-20 records each time request is made with some int value. currently I am doing this:
$prod=$_REQUEST['prod'];
$result= sql("SELECT * FROM products where pID='$prod'");
echo json_encode(array('item'=>$result));
But it gives me all products from table. how can I get 0-10, then 11-20 and so on.