In general, to accomplish your requirements, you need to:
- get the total number of rows. You can do a SELECT COUNT(*)
- calculate how many pages you have (from the number of items per page)
- for each page, you use the LIMIT to get the range from the database
In you LIMIT $1, $2, you can use:
LIMIT items_per_page, offset
where offset = items_per_page*page_number
It's basically a bunch of calculations you need to make. LIMIT works for
Postgresql. If you are using another DB, then you need to look at Castor's code
(or someone else can help out). Also, make sure you have the latest CVS version.
Keith C
> HI
> Thanx for u reply.But i want records the from getting the last id and ran=
> ge.For e.g. If i have 100 records, first time i want to show 1 to 10 and =
> 11 to 20 and 21 to 30 and so on.I may also change the range instead of 10=
> =2EFor e.g =
>
> i would like display 5 rows per page also.I tried with ur example, it doe=
> sn't work.I would like know how to get the range using limit function.Or =
> is there any function to get rows like listRange,valuelist..
> (Sorry i couldn't post message in mailing list)
> Sathish
> =
>
>
> =
>
>
>
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev