I'm sifting through data from a query and I want to be able to address the column name dynamically, but I can't seem to figure out the syntax.
e.g. if i have 10 'columns' returned in a query I can refer to each by name:
<cfset x[1] = query.column1>
<cfset x[2] = query.column2>
...
<cfset x[3] = query.column10>
But I would rather put them in a proper loop:
<cfloop index="i" from="1" to= "10">
<cfset x = query.column#i#>
</cfloop>
Shouldn't there be am esy way to do this? I am sure I am just missing something because it doesn't like the embedded #'s in the cfset.
e.g. if i have 10 'columns' returned in a query I can refer to each by name:
<cfset x[1] = query.column1>
<cfset x[2] = query.column2>
...
<cfset x[3] = query.column10>
But I would rather put them in a proper loop:
<cfloop index="i" from="1" to= "10">
<cfset x = query.column#i#>
</cfloop>
Shouldn't there be am esy way to do this? I am sure I am just missing something because it doesn't like the embedded #'s in the cfset.