The PHP PEAR also known as PHP Extension and Application Repository, is a repository built especially for PHP software code. In this tutorial, you will learn how to install the PHP PEAR on the linux server. Install PEAR allows you to install various extensions without compiling the source packages.
This tutorial explains how to paginate database results using PEAR::Pager and Pager_Wrapper. The latter is useful, because without it (Pager_Wrapper), you are selecting the ENTIRE result set for each page, which undoes one of the important advantages of paginating.
Prepare takes the $sql (with '?'s where data will go), along with the TYPES (array) of data to prepare the sql for, and a 3rd paramater for manipulating or result-getting (see next paragraph). It assigns this to $prepared_statement.
Another array is created with the data (in the same order as the types, of course), and the RESULT is aquired by running the execute() method on the $prepared_statement object, passing the execute method the "$data" array to fill in the '?'s
After this do everything as normal.
I have a feeling that MDB2 lower cases all field names - so you'll probably need :
echo $row['name']
A good idea would be to print_r($row) or similar, to see what's in it