Raj KAJ (scottobear) wrote,
Raj KAJ
scottobear

getting ID directly from the form field associated with that ID

The final working code

<cfloop list="#FORM.fieldnames#" index="c" delimiters=",">
<cfif listfindnocase("ORDER",listfirst(c,"_"),",")>
<cfset item = "##" & "FORM." & c & "##">
    <cfquery name="reorder" datasource="guidance">
    UPDATE fed_lands_doctype
    SET type_order = <cfqueryparam value="#evaluate(item)#" cfsqltype="cf_sql_numeric">
    WHERE type_id = #listlast(c,"_")#
    </cfquery> 
</cfif>   
</cfloop>

Originally published at The Scotto Grotto. You can comment here or there.

Tags: code, uncategorized
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments