I have a CFQuery
which returns some counts.
For example:
count1 | count2 | count3
1 | 23 | 27
The result is always one row BUT the columns are not always the same. I mean sometimes might return 3 columns and sometimes 10+ columns which I don't know their names. My goal here is to loop over the names of the columns and get their values and present them in a table.
I have tried this:
<cfloop list="#qGetCommentsDetails#" index="col">
<cfloop query="qGetCommentsDetails">
#qGetCommentsDetails.[col][currentRow]#
</cfloop>
</cfloop>
but I get this error:
A CFML variable name cannot end with a "." character.
The variable qGetCommentsDetails. ends with a "." character. You must either provide an additional structure key or delete the "." character.
Anyone knows how to loop over columns and their values?