>>Would this be the best way to do this?  Other ways?

In my CMS, there are several items the user can choose the order he 
wants, ie. paragraphs in a page.
In order to do so, he has a list of all of them and he can move them up 
or down (Javascript).
On submit, a list of items is created in order chosen by the user, in a 
hidden field.
In the table, each item has a column "seq" for a sequence number.
In the update template, I simply update all sequence numbers in a loop, ie:
    <CFSET seq = 1>
    <CFLOOP INDEX="paraId" LIST="#listPara#">
        <CFQUERY DATASOURCE=#application.applicationName#>
            UPDATE paragraphs SET
                seq = #seq#
            WHERE paraId = #paraId#
        </CFQUERY>
        <CFSET seq = seq+1>
    </CFLOOP>

Then use the seq column to sort by your queries.
It may be a little more overhead on the database, but for items in small 
numbers (say less than 1000),
it is marginal.
And it is much simpler to handle than leaving holes between numbers and 
eventually renumber items
any way when there are no more holes left.

-- 
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:301164
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