Solved

Executing N number of queries based on form results.

Posted on 2003-11-11
1
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

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…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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