Since I have no idea what form.opt contains, or what is in the getOptions
query, or what is in getOptions2, it's impossible to help you. Honestly this
is so convoluted and has such confusing naming conventions I can't even
GUESS at what this is supposed to do. I mean, what kind of names are "opt",
"i", "this", and "getOptions2"? Code is supposed to be self-documenting, and
one of the ways it does that is by using meaningful variable names.

I really am trying to help you here Erik. You're a very interesting case. I
mean, do you have a specific reason for refusing to actually read through a
CF book or a SQL book? You do realize that a huge number of the problems you
post about would be solved if you would just do that, right?

And I guess I'm a glutton for punishment because I keep responding to you to
try and nudge you in the right direction. OK, clearly explain to me what you
want this code to do. What are you starting with, and what do you want the
end result to be?



On Fri, Apr 25, 2008 at 1:36 PM, erik tom <[EMAIL PROTECTED]> wrote:

> The updated query is here. Its updates all fields rather than only modified
> fields
> <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>
>
>
> >First, "it does not seem to be working properly" is not a useful
> description
> >of a problem. WHAT is it doing that makes you think it is not working
> >properly. You must explain yourself. I have sent over the link to the
> Smart
> >Questions page to you on many occasions, but clearly you still have never
> >read it. 
> >http://catb.org/~esr/faqs/smart-questions.html<http://catb.org/%7Eesr/faqs/smart-questions.html>
> >
> >Second, why aren't you using a list loop to loop over the list?
> >
> >Third, the cfif is only going to do anything if the recordcount is 0,
> which
> >means the second query will never work.
> >
> >Fourth, you ignored Bobby's advice to actually read a basic ColdFusion
> book.
> >Can I turn this into a plea? Can you please, please read a basic
> ColdFusion
> >book and a basic SQL book? Why won't you do this?
> >
> >
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:304244
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to