Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi,

Why dont you try  LIMIT in MySQL?

you can have your SQL as

SELECT * FROM your_table ORDER BY id LIMIT 0, 15
here limit statement will limit the number of records returned. In limit statement, 1st numeric value is the first record to be returned (offset) and 2nd numeric value is the number of records (row count). i.e. LIMIT 0, 15 will return 1st 15 records ( 0th to 14th)LIMIT 15, 15will return next 15 records ( 15th to 29th) and so on. For more details pllease refer to SELECT Syntax

Your link can be like "script.pl?page=0&orderby=id" page 1 | "script.pl?page=15&orderby=id" to enable pagination.

A step-by-step procedure to get pagination explained at Re: DB Search.

Cheers !

--VC

Updates :
Have a look at PerlMonks FAQ, The Perl Monks Guide to the Monastery for more information on how the Monastery works. How (Not) To Ask A Question will be a good guide. There are hundreds of thousands of posts here, Super Search is your friend. There are more than one postings available in the monastery regarding pagination



There are three sides to any argument.....
your side, my side and the right side.


In reply to Re: how to put links on the bottom of an image gallery by atemon
in thread how to put links on the bottom of an image gallery by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found