Solved

Executing N number of queries based on form results.

Posted on 2003-11-11
1
142 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
ID: 9725652
I think what you are looking for is
...values (#evaluate('form.type_id#i#')#,#evaluate('form.qtext#i#')#)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
A short film showing how OnPage and Connectwise integration works.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

10 Experts available now in Live!

Get 1:1 Help Now