Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: paginator help

by geektron (Curate)
on May 21, 2004 at 05:40 UTC ( [id://355189]=note: print w/replies, xml ) Need Help??


in reply to paginator help

well, it is something you can easily do with 2 DB queries (one using LIMIT and a start/end pair -- or even just a start and calculate the end) passed into the application.

first query just gets the number of rows, second gets the limit .. and use the results of the first divided by the number of elements per page, and you have the number of pages.

process that number of pages as needed per templating system. i generate an array of hashrefs to pass into HTML::Template for stuff i've been doing recently. it's been a while since i've used Template::Toolkit.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found