select * from table limit a, b-- from a beginning, b show bar
m-- pages, n-- number per page, limit n * (m-1), n
A, select count (*) from table-- get the total number of
Second, the two cases, the total number of pieces divided by the number displayed per page, to get the number of pages divisible, otherwise the value +1 is the number of pages
When the need to return query results more content and number of pages, create a new entity class, the result set various attributes of the entity class, then this entity class object returns
Checking the number of pages, the maximum is greater than the maximum number of pages is displayed, the first page is less than the minimum content page is displayed