Hello all,
Well I am still struggling to wrap my head around structures. (this is a
continuation of yesterday's conversation where I have dynamically generated
field names.)

I have the following code:

<cfset languageNameStruct = StructNew()>

    <cfloop index="i" list="#form.fieldnames#">
    <cfif (find("_", i) GT 0) AND (len(trim(form[i])) GT 0)>

        <cfset val = StructInsert(languageNameStruct, "#i#", "#form[i]#")>

  <cfquery datasource="#Application.dsource#">
        INSERT INTO tblElection_Committee
        (Proc_ID, Name, Phone, Email)
        VALUES (#Session.Procedure_ID#, Not sure what to put here)
    </cfquery>
    </cfif>
    </cfloop>

The problem is I do not know what to put in the VALUES part of the insert
query. I need it to enter the persons name, phone and email, then loop
through to the next name, phone and email, etc.. When I cfdump the
structure, it looks like this:

struct
NAME_1 Park Kim

struct
NAME_1 Park Kim
PHONE_1 213-456-7890

struct
NAME_1 Park Kim
PHONE_1 213-456-7890
EMAIL_1 [EMAIL PROTECTED]

it continues to build for every row that I have until I have this monsterous
struct. I know it has to be simple but I guess I am looking into this to
deep or something. I googled looping through ColdFusion structs but it is
still not making sense. Call me stupid but I am just not getting it.

Bruce


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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