You can divide database results into pages with this script. This source code is for available to use with MySQL. But you can modify the code to use with PostgreSql and Oracle. You can not use this code with MS-SQL. Becuase MS-SQL does not support using 'LIMIT' in your sql queries.