Question
Coldfusion tags within query output
I have a simple query to a SQL database that returns a record
set. Within the record set is a field that contains HTML and CFML.
When I display the content it reads the CF tags literally. Is there
any way to get the CF tags to be processed when it is returned in
the query output? See example below.
------------------ CODE ON PAGE -------------------------------
<CFQUERY name="getdata" datasource="DSN">
select ID, HTMLFIELD
from TABLENAME
where ID = '1'
</CFQUERY>
<CFOUTPUT QUERY="getdata">
#getdata.HTMLFIELD#
</CFOUTPUT>
-----------------------VALUE OF "HTMLFIELD" VARIABLE--------------------------------
<CFSET todaysdate = #DateFormat(Now(), "mm/dd/yyyy")#>
<p>Today is #variables.todaysdate#</p>
------------------------WHAT IS DISPLAYED IN THE BROWSER----------------
Today is #variables.todaysdate#
-----------------------WHAT should BE DISPLAYED IN THE BROWSER------------
Today is 06/14/2006
------------------ CODE ON PAGE -------------------------------
<CFQUERY name="getdata" datasource="DSN">
select ID, HTMLFIELD
from TABLENAME
where ID = '1'
</CFQUERY>
<CFOUTPUT QUERY="getdata">
#getdata.HTMLFIELD#
</CFOUTPUT>
-----------------------VALUE OF "HTMLFIELD" VARIABLE--------------------------------
<CFSET todaysdate = #DateFormat(Now(), "mm/dd/yyyy")#>
<p>Today is #variables.todaysdate#</p>
------------------------WHAT IS DISPLAYED IN THE BROWSER----------------
Today is #variables.todaysdate#
-----------------------WHAT should BE DISPLAYED IN THE BROWSER------------
Today is 06/14/2006