I don't have exapmple rigth now, but I can show the main idea. If you're using MySQL database, you limit records for output by using "LIMIT" with offset in your SELECT statement. So, when you move to the next page, just change offset. All you have to do now is to define how many pages you will have and to check that offset is not more than this number.