Assuming that flash.which and flash.answergiven are comma delimited
lists and contain the same number of elements then you should be able
to do something like this...
<cfquery name="updateans" datasource="database">
<cfloop from="1" to="#listLen(flash.which)#" index="i">
UPDATE Participants
SET #ListGetAt(flash.which,i)# =
'#ListGetAt(flash.answergiven,i)#'
WHERE PartID = #flash.login#
</cfloop>
</cfquery>
[quoted text, click to view] dondalinger wrote:
> Hello, thanks for reading...
>
> what I'm trying to do is below and it works...
>
> <cfquery name="updateans" datasource="database">
> UPDATE Participants
> SET sect1answer1 ='#flash.answergiven#'
> WHERE PartID = #flash.login#
> </cfquery>
>
> but I want to reuse this query for several fields so I'm trying to do this:
>
> <cfquery name="updateans" datasource="database">
> UPDATE Participants
> SET ('#flash.which#') ='#flash.answergiven#'
> WHERE PartID = #flash.login#
> </cfquery>
>
> This does not work, I've tried evaluate and cfset but neither one seems to be
> the solution, any one know what the syntax is?
>
> THanks!!!