Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: HTML::Pager, Navigation not working

by sacked (Hermit)
on Oct 24, 2005 at 20:51 UTC ( [id://502578]=note: print w/replies, xml ) Need Help??


in reply to HTML::Pager, Navigation not working

From the HTML::Pager docs:
get_data_callback - this is a callback that you provide to get the pages of data. It is passed two arguements - the offset and the number of rows in the page. You return an array ref containing array refs of row data. For you DBI-heads, this is very similar to selectall_arrayref() - so similar that for very simple cases you can just pass the result through.
In addition to the problem described by perl_lover above, your get_data_callback ignores the paging variables (offset and row count). Since you are using MySQL, you should be able to use the LIMIT modifier to your select statement to handle paging:
my $get_data_sub= sub { my ( $offset, $rows ) = @_; # ... my $stmtHandle = $dbHandle->prepare(<<" END"); SELECT sno, name, age, deptno FROM sample1 LIMIT $offset, $rows END # rest of code as before

--sacked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://502578]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found