I have a table with user answers from a test. There are columns to hold the
answers with the column names of "question1", "question 2", "question3", ....
"question50".
I want to loop through a query to show the answers. Here is what I have:
<!--- LOOP THROUGH THE NUMBER OF QUESTIONS (6 QUESTIONS) --->
<cfloop from="1" to="#number_of_questions_in_test#" index="i">
<!--- THERE ARE THREE RECORDS, SHOW ALL THE RESULTS OF QUESTION1, THEN
QUESTION2, ... QUESTION6 --->
<cfloop query="qGetTestResults">
<cfoutput>#question[i]#</cfoutput><br />
</cfloop>
</cfloop>
The problem is, I keep getting an error "Variable QUESTION is undefined." I
know this should be possible and it is probably a simple syntax error.
Any suggestions?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5354
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm