For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > January 2005 > PEAR::Pager, paging records









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PEAR::Pager, paging records
Robert

2005-01-25, 9:00 pm

I almost have the thing working. I am using the Pager_Wrapper_DB() using the
following:

$page->assign('pageData', Pager_Wrapper_DB($dbh, $sql, $pagerOptions));

I am assigning it in the page using:

{section name=pager loop=$pageData}
<tr class="{cycle values="trcol1,trcol2"}">
<td>{$pageData.data[pager].SURNAME}</td>
<td>{$pageData.data[pager].FIRST_NAME}</td>
<td>{$pageData.data[pager].USERID}</td>
<td>{$pageData.data[pager].PROFILE}</td>
<td>{$pageData.data[pager].POSITION}</td>
</tr>
{/section}
</table>
<br>
<div align="center">
<table width="90%" cellspacing="0" cellpadding="2" class="content">
<tr>
<th class="center">{$pageData.links}</th>
</tr>
</table>
</div>

I have two problems and two questions:

Problem #1: It is not returning everything it should. If I run the query I
get 3 more records than it is paging. The paging is working in both sliding
and jumping mode it just isn't returning everything. I have tried setting
the "perPage" to diffent levels but nada.

Problem #2: The results per page isn't correct either. It is showing six
hits per page. I am using the following:

$pagerOptions = Array(
'mode' => 'Jumping',
'delta' => 2,
'perPage' => 10,
);

Question #1: What options can be passed using $pagerOptions and what does
'delta' do?

Question #2: What does $paged_data['page_numbers']; do? I know it is an
array but when I put it into a loop like $paged_data['page_links']; the only
thing that prints is "Array". So I do not know what it is doing and how to
use it.

I am using:

Oracle 9.2.0.2
PHP 4.3.10
PEAR::DB (latest of the site)

Any help would be appreciated...

Robert
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com