There are plenty of other possibilities too:
If you have some control over what goes in the database, you may be able to store some sort of sequence numbers
in the table data, and use that in your select.
If you are looking at "most recent" pages (like this forum software does for the
thread lists) you might be able to select based on timestamp (say just the last two hours or two days etc.) then do the entries-per-page counting from the loaded data.
If you are worried about the problem of a database hit for every page, you might want to look carefully at your usage model. It's
very common in paged systems that the first page gets something like 90% of the visits, the second page 90% of the remainder and so on. (Honestly, how often have you ever looked at the fifth page of results on Google?) Selecting (and caching) the first three or four pages each time) might then answer 99.99% of your page views.