Expand variable embedded inside an sql table
Posted on 2006-11-08
How can I expand a variable which is embedded within a table column, itself expanded by a cfquery output?
A query, FilesInfo.description, is enclosed with cfoutput tags (see below). This is a column inside my sql table, data type varchar.
I want to edit the contents of FilesInfo.description and insert a variable in the middle of the text. When FilesInfo.description is expanded, the new variable is also expanded.
I guess you can see this as a variable within a variable, and it seems to me I read one cannot do this. But I'm hoping there is another way.
Here's the contents of "filesInfo.description".
"Story of a group of filmmakers traveled to Skull Island. <cfoutput>#variable#</cfoutput> They intended to investigate legends of a giant gorilla named Kong."
The problem is when expanded, #FilesInfo.description# displays my embedded variable name like this:
"This is the story of a group of explorers and documentary filmmakers traveled to Skull Island. #variable# There they intend to investigate legends of a giant gorilla named Kong."
The variable is not expanded. Is there a workaround or a different method to do this without having to change my database design?
<cfquery name="FilesInfo" datasource="Library">
where area_id = #area_id#