I'm fairly new, as you'll see. I want to create the following variables:
V1
= word 1 in my queryV2
= word 2 in my query- etc...
I can do this statically like so:
<cfset V1=#qryGetWords["WordName"][1]#>
<cfset V2=#qryGetWords["WordName"][2]#>
<cfset V3=#qryGetWords["WordName"][3]#>
<cfset V4=#qryGetWords["WordName"][4]#>
but I want to do it dynamically. I've seen other answers but I can't get them to work either. Can anything like the following work with a tweak to the syntax?
<cfloop query="qryGetWords" index="i">
<cfset "V#i#" = #qryGetWords["WordName"]["i"]#>
</cfloop>
Can I not have an index and a query within the cfloop?