kt03
2008-08-19 18:10:24 UTC
<cfquery name="qTableSelected" datasource="#request.DSN#">
select * from #variables.tableSelected#
</cfquery>
<cfset curRow = 1>
<cfloop list="#qTableSelected.ColumnList#" DELIMITERS="," index="column">
<cfif curRow eq 1>
<cfset columnID = #column# /> <!---get ID--->
<cfelse><!---get name--->
<cfset columnName = #column# />
<cfloop query="qTableSelected">
#evaluate(columnName)#
</cfloop>
</cfloop>
I have table category (CategoryId, Category)
With the code above, I am displaying the columname not the column Id.
As currenlty, it's display the id but if from category table,
I change Category to CategoryName then it displays name not id. I don't
understand why
the column is matter and it needs to have the letter "Name" at the end in
order to
dispplay the name?
select * from #variables.tableSelected#
</cfquery>
<cfset curRow = 1>
<cfloop list="#qTableSelected.ColumnList#" DELIMITERS="," index="column">
<cfif curRow eq 1>
<cfset columnID = #column# /> <!---get ID--->
<cfelse><!---get name--->
<cfset columnName = #column# />
<cfloop query="qTableSelected">
#evaluate(columnName)#
</cfloop>
</cfloop>
I have table category (CategoryId, Category)
With the code above, I am displaying the columname not the column Id.
As currenlty, it's display the id but if from category table,
I change Category to CategoryName then it displays name not id. I don't
understand why
the column is matter and it needs to have the letter "Name" at the end in
order to
dispplay the name?