Thanks for those options, Sonny & Dan...

Casey... yes, the random option is definitely possible.
The site I'm currently rebuilding for an agency uses that approach.

However, another agency prefers to order by seniority, so I have to
be prepared to deliver that option, too.

Thanks for the input!

Rick

> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 13, 2008 7:28 AM
> To: CF-Talk
> Subject: RE: Best way to order appearance of database content...
> 
> Rick,
> 
> >Say, I've got two agents in the db.  First has display-order 10, second has
> >display-order 20.  A third agent is added who is to be displayed second, so
> >is given the display-order number 15 in the form.  When the form is
> >submitted,
> >the first agent retains number 10, the new second agent's number is rounded
> >up from 15
> >to 20, and the agent whose number was 20 now has the number 30.  That way
> >there
> >are always values between the agents' display-order numbers to add new
> >agents.
> >
> >Make any sense?
> >
> >Would this be the best way to do this?  Other ways?
> 
> There's no reason to use number in multiples of 10. Just store their real
> order and do something like:
> 
> <cfset iNewUserOrder = 3 />
> 
> <!---// do this before inserting //--->
> <cfquery>
>       update
>               Employees
>       set
>               display-order = display-order + 1
>       where
>               display-order >= #iNewUserOrder#
> </cfquery>
> 
> Then ever user who's order was 3 or more is shifted up and then you can
> actually insert the new user at position 3.
> 
> -Dan
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301161
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