Pager Question

KeithHurst - July 22, 2008 - 13:00

I have a pager on one of my pages, some of the code is as follows...

$num_in_list = 10;
$result = pager_query( $sql, $num_in_list, 0, $count_sql );
.
. more code in between
.
$output = theme('table', $header, $rows);
$output .= theme('pager', $num_in_list, 0);

On the page in question I only have 7 entries so far but I still get...

1 2 next> last>>

Obviously there should only be the one page displayed.

If I do press the 2 link I get...

No recent items.

which is what I would expect for a blank page.

Any ideas ?

Keith

What you have shown implies

nevets - July 22, 2008 - 14:01

What you have shown implies $sql and $cound_sql are returning a different number of rows.

Thanks, I checked my two SQL

KeithHurst - July 22, 2008 - 14:33

Thanks, I checked my two SQL statements and that's exactly what it was, missed out an addition where clause on my count.

DOH !

Thanks,
Keith

 
 

Drupal is a registered trademark of Dries Buytaert.