#form.answer##i# tries to return the value of form.answer, followed by the value of i. You want something like this: form["answer" & i]
HTH. --Ben Stuart Kidd wrote: > Hi guys, > > I've got a problem whereby I'm trying to reference my looped variable in an > SQL statement. > > <!-- Update the answers in the database --> > <cfloop index="i" from="1" to="#CheckQuestions.recordCount#"> > <cfquery name="UpdateAnswers" datasource="user020"> > UPDATE tbl_020publicQuestions > SET answer = '#form.answer##i#' > WHERE interviewID = #CheckInterview.interviewID[i]# > </cfquery> > </cfloop> > > > My problem appears to be the line SET answer = '#form.answer##i#' - any > ideas how I can get this to work? In my form I had answers put into a loop > (answer1 answer2 answer3 etc). > > Thanks, > > Saturday > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203894 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

