Skip to main content
Inspiring
October 13, 2006
Question

Output variables stored in database

  • October 13, 2006
  • 2 replies
  • 309 views
Hi,

Does anyone know if it is possible to save variables into a database such as the currentdate and then when you grab that data and cfoutput it have the variable be populated. For example I insert some text in the database and I want to add the current date, I would insert the following into the db:

"Some text and today is #LSDateFormat(Now(),"dddd")#. Some more text..."

Then I run a query to grab the above data from the database and cfoutput to give the following result:

Some text and today is Friday. Some more text...

Is this possible? Is there a way to do it? Or do we have to simply find and replace certain keywords and replace them with the dynamic stuff at runtime?

Cheers,

Dave
    This topic has been closed for replies.

    2 replies

    Inspiring
    October 13, 2006
    For that specific example, if your db has the functionality, it is so much easier to use it than it is to try to get cf code to work. It will run faster too.
    Inspiring
    October 13, 2006
    Yes, you use a combination of evaluate() and de() [delay evaluate]
    functions. This is a frequent topic so a search of the archives, google
    or CF documentation should get you all the details.