Vincent

I don't know of any way you can do this in SQL but just a simple query and a
post works great.

This should work for you.  Adjust the cache time span to meet your needs.


-Mark :o)

Learning = (Asking + Teaching)


<CFQUERY NAME="get_items" DATASOURCE="users"
CACHEDWITHIN="#CreateTimeSpan(0,0,5,0)#">
SELECT itemnum, user_id
FROM items
WHERE user_id = 12345
</CFQUERY>

<CFSET MaxRows = 10>
<CFPARAM NAME="Begin" DEFAULT="1">
<CFPARAM NAME="itemnum" DEFAULT="">
<CFPARAM NAME="user_id " DEFAULT="">

<CFOUTPUT QUERY="get_items" STARTROW=#Begin# MAXROWS=#MaxRows#>
#itemnum#<br>
</CFOUTPUT>

<CFSET NextTen = Begin + MaxRows>

<CFOUTPUT>
<CFIF NextTen LTE get_items.RecordCount>
<FORM ACTION="get_items.cfm"  METHOD="post">
<INPUT TYPE="hidden" NAME="ItemNumber" VALUE="#itemnum#">
<INPUT TYPE="hidden" NAME="Begin" VALUE="#NextTen#">
<INPUT TYPE="submit" VALUE="Next #MaxRows#">
</FORM>
</CFIF>
</CFOUTPUT>



----- Original Message -----
From: Vincent <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Thursday, September 28, 2000 10:36 PM
Subject: A <cfquery> problem.


> hi,
>   I guess this is more of an SQL problem... what I wanted was
> for me to be able to select a group of rows in my cfquery statement.
> eg:
>   <cfquery name="get_items" datasource="users" maxrows = 10>
>   SELECT itemnum
>    FROM items
>    WHERE user_id = 12345
> </cfquery>
>
> Now this will get me the top 10 rows, yes! Now what Im looking at is
> rows 10-20, then 20-30....etc
>
> Is this possible. I know of one way, but its kinda a long cut.
>
> thanks
> regards,
>
> VIN
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> 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.mail-archive.com/cf-talk@houseoffusion.com/
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