[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Executing N number of queries based on form results.

Posted on 2003-11-11
1
Medium Priority
?
154 Views
Last Modified: 2013-12-24
I'm gathering N number of questions from a form, and inserting them into a table. So I use a loop to accept N questions from the form and execute N number of queries.

I want to do the insert #FORM.qcount# times, referencing the values FORM.type_idX where X is the number in the loop.  I can't figure out how to get the field names, represented below by FORM.type_idX and FORM.qtextX to show up right.

<cfloop index="i" from="1" to="#FORM.qcount#" step="1">
<!--- insert the question into the pool --->
<cfquery datasource="#DSN#" username="#acuiwebdbuser#" password="#acuiwebdbpass#" name="InsertQuestions">
INSERT into survey_qtext (type_id, text) values ('#FORM.type_idX#', '#FORM.qtextX#')
</cfquery>
</cfloop>

I've tried everything I can think of, even setting variables and then using the variables. What am I missing?

Amy
0
Comment
Question by:alyoung
1 Comment
 
LVL 2

Accepted Solution

by:
jonnygo55 earned 2000 total points
ID: 9725652
I think what you are looking for is
...values (#evaluate('form.type_id#i#')#,#evaluate('form.qtext#i#')#)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question