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

Comments

nevets’s picture

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

Keith Hurst’s picture

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