* John Kurkiewicz Jr.
> I am using perl 5 and linux 6. I am currently capable
> of retrieving information from my databases, but am at
> a complete loss as to how to parse the results into 20
> results per page.

Take a look at the LIMIT part of the SELECT statement.

>From the manual <URL: http://www.mysql.com/doc/S/E/SELECT.html >:

"The LIMIT clause can be used to constrain the number of rows returned by
the SELECT statement. LIMIT takes one or two numeric arguments. If two
arguments are given, the first specifies the offset of the first row to
return, the second specifies the maximum number of rows to return. The
offset of the initial row is 0 (not 1):

mysql> select * from table LIMIT 5,10;  # Retrieve rows 6-15"

For 20 rows per page, you would use:

  SELECT ... FROM ... WHERE ... ORDER BY ... LIMIT $start,20

Your initial value for $start is 0, but in the "Next page" link you set it
to 20 ($start+20).

--
Roger


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to