CURDATE()
| From: | Ron Piggott | Date: | Thu, 18 Aug 2011 07:15:36 +0000 |
| Subject: | CURDATE() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-47981@lists.php.net to get a copy of this message | ||
I am setting up a daily cron job to update the site map on my web site.
I want to delete any records that weren’t updated by the cron job each day. The way I can
distinguish this is with the timestamp column named “last_record_update” If a record wasn’t
updated it is no longer part of the web site.
I am trying to figure out if there is a way for me to use mysql’s date functions to query the
records that are no longer part of the web site.
What I tried below doesn’t work: ( CURDATE() . % )
The reason I wanted to use % is because the time will follow the date in a “timestamp” column
Is there a similar way to do what I am trying:
SELECT
reference FROM sitemap_pages WHERE last_record_update
NOT LIKE ( CURDATE() . % ) ORDER BY reference +0
Thanks for helping.
Ron
The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info