PHP Classes

Hi !! Why you do not try use the package DB of the pear of t...

Recommend this page to a friend!

      Query Limit  >  All threads  >  Hi !! Why you do not try use the...  >  (Un) Subscribe thread alerts  
Subject:Hi !! Why you do not try use the...
Summary:Package rating comment
Messages:2
Author:José Filipe Lopes Santos
Date:2008-12-29 14:26:26
Update:2008-12-29 14:44:13
 

 

José Filipe Lopes Santos rated this package as follows:

Utility: Good
Consistency: Good

  1. Hi !! Why you do not try use the...   Reply   Report abuse  
Picture of José Filipe Lopes Santos José Filipe Lopes Santos - 2008-12-29 14:26:26
Hi !!

Why you do not try use the package DB of the pear of the php ??
It has a method limitquery(sqlquery,initpos,numrows)
where
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 .... !!

  2. Re: Hi !! Why you do not try use the...   Reply   Report abuse  
Picture of Eren Ezgü 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.