Steve...
Without knowing what db you use, here's how I do it in MySQL:
<cfparam name="URL.page" default="1">
<cfparam name="totalperpage" default="25">
<!--- get total number of records --->
<cfquery name="getAll">
SELECT listing_id
FROM listings l
</cfquery>
<cfset totalrecords = getAll.recordcount>
<!--- the actual display query --->
<cfquery name="getAllInRange">
SELECT l.listing_id, l.listing_mlsnumber, l.listing_address
FROM listings l
ORDER BY l.listing_address
LIMIT #URL.start#, #totalperpage#
</cfquery>
<cfset onthispage = getAllInRange.recordcount>
<cfset totalpages = Ceiling(getAll.recordcount/totalperpage)>
<!--- display the page numbers across the top --->
<cfoutput>
<b>Displaying #onthispage# of #totalrecords# records.</b>
<br><br>
<cfif totalpages GT 1>
<div id="paging">
<cfset URL.start = 0>
<cfloop index="page" from="1" to="#totalpages#" step="1">
<cfif page EQ URL.page>
#page#
<cfelse>
<a
href="#APPLICATION.thispage#?&start=#URL.start#&page=#page#">#page#</a>
</cfif>
<cfif page NEQ totalpages>|</cfif>
<cfset URL.start = (URL.start+totalperpage)>
</cfloop>
</div><br>
</cfif>
</cfoutput>
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->
-----Original Message-----
From: Steve LaBadie [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 12, 2006 1:45 PM
To: CF-Talk
Subject: Previous/Next Button Issue
I am trying to apply a previous next button and limit the records to 10.
When the page views the data replicated 10 times for each record.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263800
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4