It is (see below) an example from the old CF 3.0 examples.
Just change it to 5 records instead of 10.

Uwe

<!---------------------------------------------------------------
 This template uses a HTML table to display the parks that
 match the inputs sent from main.cfm
----------------------------------------------------------------->

<!---------------------------------------------------------------
 This query uses dynamic SQL to construct a query that
 fits what information was sent from the previous form (main.cfm).
 You can see that the SQL conditions are added to the SQL
 if a search field was entered. The 0=0 condition is used
 in order to make sure that a fully inclusive WHERE clause is
 composed when no search constraints are set.
----------------------------------------------------------------->

<CFQUERY NAME="GetParkList" DATASOURCE="CF 3.0 Examples">
 SELECT * FROM Parks WHERE 0=0

  <CFIF #ParkName# is not "">         AND ParkName LIKE '%#ParkName#%'
</CFIF>
  <CFIF #ParkType# is not "AllTypes"> AND ParkType = '#ParkType#'   </CFIF>
  <CFIF #Region# is not "AllRegions"> AND Region = '#Region#'    </CFIF>
  <CFIF #State# is not "">            AND State = '#State#'    </CFIF>
</CFQUERY>

<!---------------------------------------------------------------
 In order to implement Next-N type of browsing. Initialize
 the StartRow variable. If it already exists, increment it by
 so than next 10 records can be displayed.
---------------------------------------------------------------->

<CFIF #ParameterExists(StartRow)# IS "No">
 <CFSET StartRow = 1>
<CFELSE>
 <CFSET StartRow = (StartRow + 10)>
</CFIF>

<HTML>
<HEAD><TITLE>National Parks Search Example</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">

<!------------------------ BANNER IMAGES ------------------------->
<A HREF="bts.cfm"><IMG SRC="../images/bts.gif" BORDER=0 ALIGN=Right></A>
<A HREF="../index.cfm"><IMG SRC="../images/back.gif" BORDER=0
ALIGN=Right></A>
<IMG SRC="../images/banners/parkssearch.gif">

<H2>Search Results:</H2>
<HR>
<P>
<CFOUTPUT>
<H3>#GetParkList.RecordCount# parks matching your search criteria were
found.</H3>
</CFOUTPUT>
<P>

<!---------------------------------------------------------------
 Show the [ Next 10 Records ] link only if there are more
 records to browse.
---------------------------------------------------------------->

<CFIF (StartRow + 9) LT GetParkList.RecordCount>
 <CFOUTPUT>
 <A
HREF="search.cfm?StartRow=#StartRow#&ParkName=#URLEncodedFormat(ParkName)#&P
arkType=#URLEncodedFormat(ParkType)#&Region=#URLEncodedFormat(Region)#&State
=#URLEncodedFormat(State)#">[ NEXT 10 RECORDS ]</A>
 </CFOUTPUT>
</CFIF>

<!--- This uses an HTML table to display the results of the above query --->

<TABLE WIDTH=100%>
<TR><TH ALIGN=LEFT>Name</TH><TH ALIGN=LEFT>City</TH><TH>State</TH></TR>

<!--- With the CFOUTPUT tag located outside the 'TR' tag, a new table row
will be
created for each record retrieved in the query, building an attractive
dynamic table --->

<CFOUTPUT QUERY="GetParkList" STARTROW=#StartRow# MAXROWS=10>
<TR>
<TD><a
href="detail.cfm?ParkName=#URLEncodedFormat(ParkName)#">#ParkName#</a></TD>
<TD ALIGN=LEFT>#City#</TD>
<TD ALIGN="CENTER">#State#</TD>
</TR>
</CFOUTPUT>
</TABLE>

</BODY>
</HTML>


SD Solutions
Uwe Degenhardt
Fon: 08122/903791
Fax: 08122/903792
Web: www.sdsolutions.de
E-Mail: [EMAIL PROTECTED]
----- Original Message -----
From: "Akbar Pasha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 17, 2000 9:30 AM
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.


------------------------------------------------------------------------------
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