Ins,

I would recommend Ben Forta's CF books since he has a very clear section on
how to implement that. In the simplist form, you have something like this:

<CFPARAM Name="Url.Page" default="1">
<CFPARAM Name="Variables.MaxPerPage" default="50">

<CFQUERY Name="myData"........>

<CFLOOP Quey="myData" startRow="#Evaluate(Url.Page * MaxPerPage - MaxPerPage
+ 1)#" endrow="#Evaluate(Url.Page * MaxPerPage)#">

    ....

</CFLOOP>


All you need to pass in is the incremented page counter (Url.Page) and
calculate the offsets depending on how many records you want per page.

StartRow and EndRow attributes do work and they work rather well. However,
if you have a query that returns something huge, like 10,000 records, I
would suggest caching and segementing the query by caching the page
boundries.

Xing



> Hi,
> 
> I have a query which returns 431 results:
> 
> <cfquery name="qGetCompany">
> select companyname
> from company
> where countrycode='au'
> </cfquery>
> 
> I want to separate these results into many pages, each
> page contains 20 results and have links to each page,
> if the current result is on page 4 ,should have this :
> 
> page1, 2, 3,<<prev,  4.. next>> 6, 7 ...20...
> 
> startrow & endrow don't work:(resuilts are not from
> continueing row numbers in the table)
> <cfloop query="qGetCompany"
> startrow="#starrowthispage#"
> endrow="#endrowthispage#">


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to