Pages

Monday, January 12, 2015

Dynamically display all column data of a cfquery // get column value dynamically cfquery coldfusion //


Dynamically display all column data of a cfquery. 

this is useful when you don't know the name of columns of your cfquery result.


<cfloop query="Data">

       <cfloop list="#data.Columnlist#" index="local.Column" delimiters="," >

        <cfoutput>
              #Data[local.column][Data.currentrow]#
        </cfoutput>

</cfloop>
</cfloop>



Notes: 
1. data is query
2. data.columnlist is comma separted columnlist of a query

No comments:

Post a Comment