SELECT * FROM `your_table` LIMIT 0, 10
This will display the first 10 results from the database.
SELECT * FROM `your_table` LIMIT 5, 5
This will show records 6, 7, 8, 9, and 10
Some people like to use OFFSET for readability, and its perfectly valid last I checked.
So to paginate you would do something like the following with count and offset being global variables (or handle them anyway you want) db is a global property in app (or if web edition a session property) while the db connection is done elsewhere (prior naturally).
db.sqlselect("SELECT * FROM `your_table` LIMIT " + cstr(i * count) + ", " + cstr(offset))
the variable i is a multiplier so your results are paginated and should be zero based. You increment i every time the "next" pagination button is clicked. It also works in reverse, the previous page of results would decrement the counter. You need to check i is never less than zero or it will return an sql error.