This is a multi-part message in MIME format.
------=_NextPart_000_0013_01BFA870.6E046AD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
-----Original Message-----
From: Akbar Pasha [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 17, 2000 3:31 AM
To: '[EMAIL PROTECTED]'
Subject: next 5 records
hi everybody,
this may look silly but i have a small problem. i hvae a query and for the
first time i want to display 5 records and on pressing the next button it
should show next 5 records...and so on. i remember seeing a solution for
this long back but i forgot. so, can anyone plzz send me the code??
thanx in advance
akbar
----------------------------------------------------------------------------
--
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.
------=_NextPart_000_0013_01BFA870.6E046AD0
Content-Type: application/octet-stream;
name="NEXTN.CFM"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="NEXTN.CFM"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Next-N example with caching</TITLE>
</HEAD>
<CFSET DSN=3D"DHPCFA_HR">
<BODY alink=3D"#0000ff" vlink=3D"#0000ff" link=3D"#0000ff">
<!--- test to see if this is the first time through --->
<cfparam name=3D"start" default=3D"1">
<!--- get query info --->
<CFQUERY NAME=3D"GetEmp" DATASOURCE=3D"#Application.DSN#">
SELECT LastName, FirstName
FROM Employees=20
ORDER BY LastName, FirstName
</CFQUERY>
<CFOUTPUT>Number of rows: #GetEmp.RecordCount#</cfoutput><br>
<!--- Just output 3 rows at a time --->
<cfoutput query=3D"GetEmp" startrow=3D"#start#" maxrows=3D"3">
#GetEmp.FirstName# #GetEmp.LastName#<br>
</cfoutput>
<br>
<!--- the previous link --->
<cfif start LE 1>
<cfset Pstart =3D 1>
<font face=3D"Comic Sans MS">Previous</font>
<cfelse>
<cfset Pstart =3D start - 3>
<cfif Pstart LE 1>
<cfset Pstart =3D 1>
</cfif>
<cfoutput>
<a href=3D"NextN.cfm?start=3D#Pstart#"><font face=3D"Comic Sans =
MS">Previous</font></a>
</cfoutput>
</cfif>
<!--- just give me some space between previous and next --->
<!--- the previous link --->
<cfset Estart =3D start + 3>
<cfif Estart gt GetEmp.RecordCount>
<cfset Estart =3D GetEmp.RecordCount - 3>
<font face=3D"Comic Sans MS">Next</font>
<cfelse>
<cfoutput>
<a href=3D"NextN.cfm?start=3D#Estart#"><font face=3D"Comic Sans =
MS">Next</font></a>
</cfoutput>
</cfif>
<!--- end page --->
</BODY>
</HTML>
------=_NextPart_000_0013_01BFA870.6E046AD0--
------------------------------------------------------------------------------
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.