I ran into a problem yesterday that I posted to CF-Talk and decided I would post here.
I have a table with a couple of columns that contain ColdFusion Variables stored within some text. When I query the database, I need the text to display and the ColdFusion variables to show their values.
When the code was written this way:
<cfoutput query=“myQuery”>
#MyText#
</cfoutput>
All that would be displayed on the screen was:
“This is some text, some more text, a #ColdFusion_Variable#, and even more text.”
By writing the code this way, I got what I needed:
<cfoutput query=“myQuery”>
<cfset ColdFusion_Variable = Evaluate(“ColdFusion_Variable”)>
<cfset new_MyText = ReplaceNoCase(MyText,“##ColdFusion_Variable##”,ColdFusion_Variable,“ALL”)>
#new_MyText#
</cfoutput>
The code outputted as:
All that would be displayed on the screen was:
“This is some text, some more text, a 500, and even more text.”
With #ColdFusion_Variable# being outputted as 500, its real value.