CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [hwnd] Another way besides using ceil?: Edit Log



Zhris
Enthusiast

Mar 31, 2013, 3:25 PM


Views: 603
Re: [hwnd] Another way besides using ceil?

I think I'm probably missing something here, but it appears you are calculating the current page number ( $pg_curr). I thought $page_id was the current page number (assumed supplied by the user).

I would expect a basic pagination system to expect the arguments:


Code
current_page     ( 4  ) ( user supplied          ) 
results_per_page ( 10 ) ( possibly user supplied )
total_results ( 34 ) ( calculated )


Then return "indexes" to the first and last result for the purpose of later retrieving the data AND the last page for the purpose of later constructing the page links:


Code
first_result ( 31 ) 
last_result ( 34 )
last_page ( 4 )


Have I misunderstood something.

Chris


(This post was edited by Zhris on Mar 31, 2013, 3:32 PM)


Edit Log:
Post edited by Zhris (Enthusiast) on Mar 31, 2013, 3:26 PM
Post edited by Zhris (Enthusiast) on Mar 31, 2013, 3:27 PM
Post edited by Zhris (Enthusiast) on Mar 31, 2013, 3:30 PM
Post edited by Zhris (Enthusiast) on Mar 31, 2013, 3:32 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives