Performance : PEAR Pager + Mysql Search Query
| From: | Yuan Yudistira | Date: | Fri, 04 Feb 2005 09:56:50 +0000 |
| Subject: | Performance : PEAR Pager + Mysql Search Query | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17376@lists.php.net to get a copy of this message | ||
Hello guys,..
I am going to use Pager from PEAR.
here is my copy paste code :
//Pager
require_once LIB.'pear/Pager/Pager.php';
//create dummy array of data
$params = array(
'itemData' => $aArtikel,
'perPage' => 4,
'delta' => 2, // for 'Jumping'-style a lower number is
better
'append' => true,
'separator' => '|',
'clearIfVoid' => false,
'urlVar' => 'entrant',
'useSessions' => true,
'closeSession' => true,
//'mode' => 'Sliding', //try switching modes
'mode' => 'Jumping',
);
$pager = & Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();
$smarty->assign('links',$links);
$smarty->assign("aListArtikel",$page_data);
Where $aArtikel is from mysql query.
I am writing MySQL query to search all artikel from the database.
I worry about the performance in the future when the number of rows
become more and more.
Please advise me the right and appropriate way to do the searching and
output the result using PEAR pager.
Thanks
YUAN
--
--------------------------------------------
Visit :
http://www.sabukhitam.net/
http://www.sabukhtam.com/
-------------------------------------------