How can I access a query column if I have the column name stored in a variable?
Use structure notation to access the recordset:
Keep in mind that with this notation you need to provide a row index as well, even within a query loop:
<cfoutput query="myQuery">
#myQuery[colName][myQuery.currentrow]#<br />
</cfoutput>
This question was written by Christoph Schmitz.
It was last updated on March 23, 2006 at 6:48:39 AM EST.
CFML Referenced
Categories
Comments
Comment made by Michael White on May 21, 2006 at 8:09 PM
You saved my bacon. Didn't even know what this entry was for until I needed it.