Array of cfquery col names
Hi peeps - got a fiddly little problem.
I'm running a cfquery on a database retrieving column names that are stored in an array.
The cfquery works fine, and i can cfdump the data with no proolem at all, however once i try to put it out in a cfoutput tag, instead of the contents of the fields, the output shows the field names. I think it's because i've nested a cfloop for the field names inside thew cfoutput tag :
<cfoutput query="qGet_cust">
<tr>
<td>#MID(LEGAL_ENTITY_CODE,2,10)#</td>
<cflock scope="session" throwontimeout="yes" type="readonly" timeout="10">
<cfloop FROM="1" TO="#ArrayLen(SESSION.parameter_array)#" index="LOCAL.this_var">
<cfset LOCAL.this_column = "qGet_cust." & "#SESSION.parameter_array[LOCAL.this_var][1]#">
<td>#LOCAL.this_column#</td>
</cfloop>
</cflock>
</tr>
</cfoutput>
The first column is the field name LEGAL_ENTITY_CODE, and that outputs the cell data with no problem. However, the subsequent cells only show the column name rather than the contents
| Header 1 | Header 2 | Header 3 | ||
|---|---|---|---|---|
| Legal Entity |
| Calls and Lines Current Year | ||
| 0003272773 | qGet_cust.INTERNET_ACCESS_cyr | qGet_cust.CALLS_AND_LINES_cyr | ||
| 0002808637 | qGet_cust.INTERNET_ACCESS_cyr | qGet_cust.CALLS_AND_LINES_cyr | ||
| 0001464359 | qGet_cust.INTERNET_ACCESS_cyr | qGet_cust.CALLS_AND_LINES_cyr |
How can i get the code to churn the contents of the query, rather than the column names ?? I'm running CF MX7. Thanks.
