Posted by "Matt Stone" on 11/23/05 15:50
----- Original Message -----
From: "twistednetadmin" <twistednetadmin@gmail.com>
To: <php-general@lists.php.net>
Sent: Wednesday, November 23, 2005 7:02 AM
Subject: [PHP] Autodeleting news when it has become yesterdays news
>I have a news-script on a webpage. Or an eventscript you might call it.
>This lists up events thats gonna happen on a given day. ie concerts and
>sportsevents.
>To get this deleted without having to log on to the adminpage when the
event
>s over would have been a great relief.
>1. Is it just as simple as writing a query that executes and removes news
>with yesterdays date?
Yup,
DELETE FROM your_table WHERE date_column = curdate() -1;
Cheers
Matt
[Back to original message]
|