What is the best way to write the following update loop using cfqueryparam?

  <cfset loopcount=0>
  <cfloop index="UpdateRecord" list="#FORM.RecordsToUpdate#">
    <cfset loopcount = loopcount+1>
    <cfset NewOrder=#ListGetAt(FORM.DisplayOrder, loopcount)#>
    <cfquery name="updDisplayOrder" datasource="#DSN#">
UPDATE Pages 
    SET Pages.DisplayOrder = #NewOrder# 
    WHERE Pages.PageID = #PageIndex#
    </cfquery>
  </cfloop> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340424
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to