I'm not highly technical, and this is probably something easy, but here is my
dilemma.
First, define some variables:
<cfset datasource = '#MyDatabase#'>
<cfset query_tbl = 'MyDatabaseTable'>
<cfset field1 = 'actual_fieldname'><!--- a field in MyDatabaseTable --->
Then, run a query using those variables:
<cfquery name="cfqGetItems" datasource="#datasource#">
SELECT *
FROM #query_tbl#
ORDER by #field1# ASC
</cfquery>
Then, attempt to display the query output:
<cfoutput>
<p>#cfqGetItems.field1#
</cfoutput>
Insead of the values for "actual_fieldname", I get an error message: "field1 is not defined in query cfqGetItems".
I realize that defining the output as "#cfqGetItems.field1#" is incorrect, but how can a "translation" be done? What is the correct way to get the output to generate the values for "actual_fieldname" instead of thinking it is still dealing with the variable "field1"?
Thank you very much for any help!