>> insert into questionOptions
>values('#variables.this#',#questionID#,#surveyID#)
>
>questionID and surveyID never change in your loop... you are just looping
>the same info into the database.
>
>.:.:.:.:.:.:.:.:.:.:.:.:.
>Bobby Hartsfield
>http://acoderslife.com
>http://cf4em.com

I rewrote the query but it kepp updating the only one box . i dynamically 
generate textboxes . that why it form.opt 
<cfif isDefined("btnOption")>
        <cfloop index="i"  from="1" to="#ListLen(form.opt)#">
 
                <cfset variables.this=ListGetAt(form.opt,i)>
                <cfquery name="getOptions" datasource="cfelsunrise" 
dbtype="odbc">
                        Select * from questionOptions where id=#optionID# order 
by id
                </cfquery>
                <cfif getOptions.recordcount eq 0>
                        <cfquery name="qryOptionSave" datasource="cfelsunrise" 
dbtype="odbc">
                                SET NOCOUNT ON
                                        insert into questionOptions 
values('#variables.this#',#questionID#,#surveyID#)
                                SET NOCOUNT OFF
                        </cfquery>
                <cfelse>
                        <cfquery name="qryOptionSave2" datasource="cfelsunrise" 
dbtype="odbc">
                                update questionOptions set 
options='#variables.this#' where  id=#optionID#
                        </cfquery>
                </cfif>
        </cfloop>
        <cflocation 
url="addremoveQuestion.cfm?surveyID=#surveyID#&optionID=#optionID#" 
addtoken="no">
</cfif> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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