Solved

Executing N number of queries based on form results.

Posted on 2003-11-11
1
140 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 500 total points
Comment Utility
I think what you are looking for is
...values (#evaluate('form.type_id#i#')#,#evaluate('form.qtext#i#')#)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now