|
Hi Ron,
Isn't it great to be able to work on the weekend
(not).
There are a number of options, with various trade-offs for
complexity and efficiency.
An easy, less efficient option is to use the startrow and
maxrows options of the cfoutput.
e.g.
<cfquery name="BODYBUILDING" datasource="#db_datasource#"
username="#db_username#">
select * FROM athlete WHERE athlete_sport = 'BODY BUILDING' order by athlete_surname ASC </cfquery> <cfoutput query="BODYBUILDING" startrow=#startat#
maxrows=20>
...
</cfoutput>
initialise startat to 1, if they click on next, add 20,
if they click on previous, subtract 20.
Don't let it go negative. You can use the
bodybuilding.recordcount field to ensure they don't go past the
end.
This technique means that every row is retrieved every
time, but only the 20 you want are displayed.
Not very efficient, but OK for retrievals of low
hundreds. If your talking in the thousands, you probably want to try and
keep track of a key value that you can use in the where
statement.
Speaking of efficiency, it is more efficient to list
the field names that you want, rather than the Select *.
Cheers,
Phil. --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ |
<<IMSTP.gif>>
<<2.jpg>>
