Here's the simplest version...

------------------------------------------
<cfparam name="url.startRow" default="1">
<cfset maxRows = 5>
<cfset prevStartRow = url.startRow - maxRows>
<cfset nextStartRow = url.startRow + maxRows>

<cfoutput query="qName" startRow="#url.startRow#" maxRows="#maxRows#">
        [show data here]
</cfoutput>

<cfif prevStartRow GT 0>
        <a href="mypage.cfm?startRow=#prevStartRow#">previous</a>
</cfif>

<cfif nextStartRow LTE qName.recordcount>       
        <a href="mypage.cfm?startRow=#nextStartRow#">next</a>
</cfif>

------------------------------------------

                                                    
Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
                                                    


-----Original Message-----
From: Adrienne H. Cregar [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 11:40 AM
To: CF-Talk
Subject: Displaying recordsets?


Hi all! I am trying to figure out how to display my recordsets in groups
of 5... you see this on search engines, etc... where you can display the
first 5 or 10, then hit the "next" button for the next set, etc...  The
examples in my books show how to limit a recordset, but not how to
display a set, with the next (and subsequent) sets on another page. Can
anyone help???

Thanks in advance!
A.Cregar


Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to