First off, this isn't going to help much :-)

Second off, I think what you'd want to do is grab a query of all your
videos, and
put it in memory somewhere.  Then do a QoQ for the records in the group you
want, and then, instead of using the actual video ID's to do your math, use
the
recordcount and currentrow attributes, so your always working with 1-10
instead
of a random amount of incrementation per record, so to speak.

See, that probably doesn't help much. :-/  Real general.  But the key point
is that
you don't have to use the videoID to keep track of where you are,
numerically
speaking, in the set.  Sorta.  Startrow/maxrows,currentRow, etc. are all
good for
this stuff.

There may be some good resources out there under "coldfusion pagination",
via
google, to help illustrate what I'm talking about.

May the Force be with you!
:Denny

On 8/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> I'm passing an id, a numeric value in a URL.value. That id value
> indentifies the
> primary key id of a record in my db. Based on that value, I want to
> get the group of records in the db that surround that  value in groups of
> 10.
> This is used to display other hyperlinked items in the same group.  I'm
> basically
> creating page views showing links of these items in these groups. I want
> to display
> the groups of the first 1-10, 11-20, 21-30 etc entries in the db. However
> some
> records have been deleted, so some of the existing primary key ids are not
> sequntial,
> the second group of 10 id values might be 11,13,14,16,17,19,22,23,24,25.
> I've
> got the code that will idenifiy what group level I am in when the URL.IDis 
> passed.
>
> QUESTION: Now I need to figure out how to extract the group of
> non-sequential ids
> to extract from the db. Hope this makes sense.
>
> Here's what I have,
>
> <cfset start = (int(url.video_id/10) * 10) + 1>
> <CFSET end=(int(url.video_id/10)+1)*10>
>
> <CFIF start EQ 1 AND end EQ 10>
> <CFSET on_page = 1>
> <CFSET next_page = 2>
> <CFELSEIF start EQ 11 AND end EQ 20>
> <CFSET on_page = 2>
> <CFSET next_page = 3>
> <CFSET previous_page = 1>
> <CFELSEIF start EQ 21 AND end EQ 30>
> <CFSET on_page = 3>
> <CFSET next_page = 4>
> <CFSET previous_page = 2>
> and so on ...
>
> TO extract the set of rows, I need to take the id and indentify where I am
> in these
> groups of 10.  So id 43 would be 2 away from 41 and 7 away from 50. How do
> I implement that into a query?  Or should I be using cf logic first?
>
> <!--- TELLS ME HOW MANY ROWS I AM AWAY FROM MY STARTINIG ROW--->
> <CFSET from_1 = URL.VIDEO_ID - start>
> <!--- TELLS ME HOW MANY ROWS I AM AWAY FROM MY STARTINIG ROW --->
> <CFSET from_2 = end - URL.VIDEO_ID>
>
> How do I write this query?
>
> D-
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251153
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to