Hi,

i have a query in which i dont know what the column names will be. however i 
have an array that contains the names of the columns but i am having 
difficulties in working out how i can reference the columns with the array. for 
example:

if i have an array that has 2 elements:
and i want to have a loop that loops through the array and an inner loop that 
loops through the query outputting the query results (using the array names to 
reference the columns)

here is an example that i know wont work but i hope will help explain what i am 
trying to do:


<cfloop index="i" from="1" to="#arraylen(myArray)#">

  <cfloop index="a" from="1" to="#queryName.recordcount#">

      <cfoutput>#queryName.myArray[i][a]#</cfoutput>

  </cfloop>

</cfloop>


the 'myArray[i]' part of the cfoutput is obviously how i am trying to reference 
the name of the column but of course the error would be element myArray[i] 
doesnt exist in queryName.

is there a way i can do this to correctly reference the column name using the 
array elements?

thanks very much for your help

richard


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294744
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to