Why you do not try use the package DB of the pear of the php ??
It has a method limitquery(sqlquery,initpos,numrows)
sqlquery is a normal query without LIMIT parameter
initpos is the initial position for this page (if every page has 15 results, is 0 for page 1, 15 for page 2, 30 for page 3, ...)
numrows is the number of the rows by page (ex: 15 rows)
Avantage: is equal for all databases (mysql, oracle, ...) and most flexible .... !!
Eren Ezgü - 2008-12-29 14:44:13 - In reply to message 1 from José Filipe Lopes Santos
thanks for your comment. in fact i havent used pear before and i think it may not be available on all servers. of course LIMIT is a simple thing for a query which actually doesnt need a class to compute parameters for. but this class may be a sample for programmers that want to learn how paginating is done. the class also may be converted to a single function that returns the limit and be a usefull tool for paging.