Re: Pager - help with trying to work with Pager with DB results set

From: Date: Wed, 16 Nov 2005 22:44:21 +0000
Subject: Re: Pager - help with trying to work with Pager with DB results set
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21950@lists.php.net to get a copy of this message
l Burnerheimerton wrote:
I want to print the data in a table. I have that set up now looping through $row, "while($row =& $resultset->fetchRow())" Do I collect all the html in a variable then send that as $data?
Hi, have a look at the Pager Wrappers in the /examples/ dir: http://cvs.php.net/co.php/pear/Pager/examples/Pager_Wrapper.php ============================================ // copy the file above or write a custom one, // then include it require_once 'Pager/Wrapper.php'; $pager_options = array(...); $db =& DB::connect(...); $query = 'SELECT ...'; $page = Pager_Wrapper_DB($db, $query, $pager_options); if (PEAR::isError($page)) {
    //oops...
} //loop through the fetched records foreach ($page['data'] as $row) {
    // print row
} ============================================ HTH Best regards, -- Lorenzo Alberton http://pear.php.net/user/quipo

« previous php.pear.general (#21950) next »