Support » Plugins and Hacks » Hacks » Pagination from custom sql table

Pagination from custom sql table

  • Hi,

    I am writing a plugin to display data from that mysql table.
    Table contains around 2mil records.
    I would like to paginate results.
    I searched the forum but unable to find the solution.
    Any help would be appreciated.

Viewing 1 replies (of 1 total)
  • There’s many ways to paginate. One way would be to query only for the records that would be on a particular page by appending a LIMIT constraint to your basic query. So if you want 50 results per page, then for a page 3 request, add LIMIT 100, 50 to your query to get only the page 3 results: records 100-149.

    Obviously, you first will need to use a COUNT query to determine the page range to display to the user.

Viewing 1 replies (of 1 total)
  • The topic ‘Pagination from custom sql table’ is closed to new replies.