Skip to main content
Inspiring
June 16, 2006
Question

Adding CFTags to Database Retrieval...Can it be done?

  • June 16, 2006
  • 1 reply
  • 273 views
Here is my dilemma, I am pulling some data from an Access database using the CFOUTPUT tag, simple enough. However, within that data, I wanted to include a variable that coldfusion would populate. For example, the data would be:

To access the system, use the name: #user_name# and the password #user_pass#.

Can this be done? I have also tried using the code in the data, eg:

To access the system, use the name: <CFOUTPUT>#query.user_name# and the password #query.user_pass#.</CFOUTPUT>

Both times have resulted in the data being populated literally rather than dynamically. Again, I'm not sure if this is even possible, but I'm not the most advanced CF programmer :). Thanks in advance for any help.
This topic has been closed for replies.

1 reply

Participating Frequently
June 16, 2006
You don't pull data with the CFOUTPUT command you pull it with the CFQUERY command and display it with the CFOUTPUT. That said your second example should work perfectly if you ran a <CFQUERY name="query"> somewhere in front of it. If you did do this make sure the query actually found something <cfdump var="#query#>. Also substitute the word myquery, query might be a keyword.