I'm trying to put links on the bottom of my pages on my image gallery to flip back and forth between pages. I'm showing 15 images per page which is sucked from MySQL. I'd like to say I'm going to be pulling them out with just the ID field but I think I'll have it sortable by other fields (date, name, etc) and I'm not sure how that'll affect anything.
How can I print the number of pages in links ("script.pl?page=1&orderby=id" page 1 | "script.pl?page=2&orderby=id", etc) and then have a reference point from where I left off previously?
My initial idea was to sort by the field, do a counter and ignore the first 15 per page (so if it were page 2, it'd ignore the first 30). I know there's probably a better way and I'm looking forward to seeing how you guys would solve this problem.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.