Q:

Limiting fetching data from database as user loads (Pagination)

I am in between development of a small app in which the data gets fetched from a MySQL database.  Suppose if there are around 100 entries in the database and I wanted only the first 10 entries to be fetched and only if the user clicks load or show more then the next 10 entries must be loaded in the same listview. 
I am using json parser to parse the data fetched and the json object will be created from all data in the table using a php.  I can limit the for loop of the json parser to parse only the first 10 objects but I am not getting how to accomplish the above feature. 
the json parser used is. 
private void parseJsonFeed(JSONObject response) {
        try {
            JSONArray feedArray = response.getJSONArray("feed");

            for (int i = 0; i < feedArray.length(); i++) {
                JSONObject feedObj = (JSONObject) feedArray.get(i);

                FeedItem item = new FeedItem();
                item.setId(feedObj.getInt("id"));
                item.setName(feedObj.getString("name"));

                // Image might be null sometimes
                String image = feedObj.isNull("image") ?  null : feedObj
                        .getString("image");
                item.setImge(image);
                item.setStatus(feedObj.getString("status"));
                item.setProfilePic(feedObj.getString("profilePic"));
                item.setTimeStamp(feedObj.getString("timeStamp"));

                // url might be null sometimes
                String feedUrl = feedObj.isNull("url") ?  null : feedObj
                        .getString("url");
                item.setUrl(feedUrl);

                feedItems.add(item);
            }

            // notify data changes to list adapater
            listAdapter.notifyDataSetChanged();
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}

the xml layout is just a simple listview which gets inflated by a custom adapter. 
and where should I place the load more button so that it is the 11th item or the button should be displayed after the first 10 list items. 
thank you. 

A:

You should try this, on the serverside: http://www.w3schools.com/php/php_mysql_select_limit.asp
$sql = "SELECT * FROM YOUR_TABLE LIMIT a,b";

"a" is the offset, "b" is the limit

