News Feed
Sections
News Archive


Community Events






feed this:

PHPFreaks.com:
Basic Pagination
1 comment :: posted Thursday June 19, 2008 @ 08:47:56
voice your opinion now!

A new tutorial has been posted on the PHPFreaks.com site today dealing with paginating your data (in their example, info from a database).

It makes way more sense to break up your list into page-sized chunks, and only query your database one chunk at a time. This drastically reduces server processing time and page load time, as well as gives your user smaller pieces of info to digest, so he doesn't choke on whatever crap you're trying to feed him. The act of doing this is called pagination.

They include the full script for those that want to jump right in and the detailed info in the rest of the tutorial for those that need a little more insight. The script gets a count of the results first then uses the LIMIT format for MySQL to restrict the number of rows returned each time and where to start those returned rows from.

tagged with: pagination tutorial mysql database limit


Chris Hartjes' Blog:
Custom CakePHP 1.2 Pagination Queries
0 comments :: posted Wednesday March 05, 2008 @ 20:54:00
voice your opinion now!

Chris Hartjes has posted some custom queries that showcase the CakePHP framework's paginaton capabilities:

Okay, so it turns out that the paginate() method that is used to generate the data that you (oddly enough) paginate through takes the same arguments as Model::findAll(). So, if you want to use your own query, you simply create a 'paginate' method for your model.

His queries show the two parts of the equation - fetching the paginated results themselves and grabbing what the current page number is (like "page 7 of 23").

tagged with: cakephp pagination query framework page


framework developer ajax pecl zend cakephp security PEAR PHP5 mysql code release job database zendframework book conference application releases package

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework