Did you read my response to this same question in the other thread before you decided to post it yet again as a duplicate thread?
On Fri, Apr 25, 2008 at 12:37 PM, erik tom <[EMAIL PROTECTED]> wrote: > I have problem updating the DB table. > I have 3 text boxes which has specific id. if the value of that boxes > changed i wanto compare to DB and update the option for that id and only for > that id . Instead it updates for all ids > > <cfif isDefined("btnOption")> > <cfloop index="i" from="1" to="#ListLen(form.opt)#"> > <cfset variables.this=ListGetAt(form.opt,i)> > <cfloop query="getOptions"> > <cfset option2=#getOptions.id#> > > <cfquery name="getOptions2" datasource="cfelsunrise" > dbtype="odbc" > > select * from questionOptions where id in (#option2#) and options > ='#variables.this#' > </cfquery> > > <cfif getOptions2.recordcount eq 0> > > <cfquery name="qryOptionSave2" > datasource="cfelsunrise" dbtype="odbc"> > update questionOptions set > options='#variables.this#' where id='#option2#' and surveyID=#surveyID# and > questionID=#questionID# > </cfquery> > </cfif> > > </cfloop> > </cfloop> > <!--- <cflocation url="addRemoveQuestion.cfm?surveyID=#surveyID#" > 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:304241 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4