Yup, nice catch...that's why I put "might not be exactly correct" at the bottom! :o) Also now that I look again it should be "#ArrayLen(itemNamesArray)#" in the cfloop tag rather than "#len(itemNamesArray)#".
-- Josh ----- Original Message ----- From: "Roberto Perez" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Saturday, February 18, 2006 1:57 PM Subject: Re: multiple INSERT - same fields > At 01:05 PM 2/18/2006, Josh Nathanson wrote: > >>Finally loop over the length of the array and do your inserts: >> >><cfloop from="1" to="#len(itemNamesArray)#" index="i"> >><cfif isDefined("itemNamesArray[i]") AND itemRanksArray[i] NEQ "none"> >><cfquery datasource="ranking_dsn"> >>INSERT INTO rank_tb (itemName, itemRank) >>VALUES (#itemName[i]#, #itemRank[i]#) >></cfquery> >></cfif> >></cfloop> > > > Thanks for the response. In the VALUES area, shouldn't the variables > read #itemNamesArray[i]# instead of #itemName[i]# (same for > itemRank)? I thought we would define itemNamesArray with the CFSET so > that we could use it in each INSERT statement... > > Thanks, > > Roberto > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232803 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

