Displaying Daily Messages

4 posts by 3 authors in: Forums > CMS Builder
Last Post: October 15, 2010   (RSS)

I have a multi section editor set up containing 'title' 'content' and 'date'. I have no idea how to get the page to display ONLY the current section that matches today's date.

For example... I need the page to ONLY display the section that has TODAY's DATE. And if there's no section with today's date, display nothing.

That would mean this section would also disappear after midnight because the date wouldn't match up.

Can you assist?
John Tedesco

Creative Director



JAM Graphics

Re: [jtedescojam] Displaying Daily Messages

By Dave - February 9, 2010

Hi jtedescojam,

You need to use MySQL date functions for this:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

Try this:
'where' => "YEAR(date) = YEAR(NOW()) AND DAYOFYEAR(date) = DAYOFYEAR(NOW())",

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [zickey] Displaying Daily Messages

By Dave - October 15, 2010

Glad to help! :)
Dave Edis - Senior Developer
interactivetools.com