> I keep getting a 'Just in time compilation' error when I run 
> the code below. It doesn't like the way I am referring to my 
> array in terms of the 'LoopCount' Variable. I'm just trying 
> to make that variable dynamic.
> 
> I can't figure out how to make this work. I have the <cfset 
> loopcount = 5> there just for show but it is actually also dynamic.
...
> <cfset loopcount = 5>
> 
> <cfloop index="index" from="1" to="#LoopCount#">
> 
> <cfquery datasource="rsvp" name="InsertRSVP">
> INSERT INTO ABCAttendees
> (FirstName, LastName, Title, Company, Email, WhatTime)
> VALUES
> '#Guests[#LoopCount#][1]#', '#Guests[#LoopCount#][2]#', 
> '#Guests[#LoopCount#][3]#', '#Guests[#LoopCount#][4]#', 
> '#Guests[#LoopCount#][5]#', '#Guests[#LoopCount#][6]#')
> </cfquery>
> 
> </cfloop>

The problem is that you've got too many pound signs. Try this:

<cfquery datasource="rsvp" name="InsertRSVP">
INSERT INTO ABCAttendees
(FirstName, LastName, Title, Company, Email, WhatTime)
VALUES
'#Guests[LoopCount][1]', '#Guests[LoopCount][2]#', 
'#Guests[LoopCount][3]#', '#Guests[LoopCount][4]#', 
'#Guests[LoopCount][5]#', '#Guests[LoopCount][6]#')
</cfquery>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to