RE: setting 'expiry date'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I have a php/mysql database with articles. What I need is a php sctipt
> that
> will compare the current day with the 'expiry date' entered by the user
> and
> if the there is a difference then drop it from the database..
> 
> I retrieve the date (called time and format it like this...
> 
> $query= "SELECT DATE_FORMAT(time, '%d.%m.%Y') AS time, article, id FROM
> news
> ORDER BY id DESC";
> 
> 
> The expiry date is entered through a javascript widget and is in the
> format
> dd/mm/yyyy.

Hi Ross,

Is there a real reason for deleting the articles? Why not only display
articles where the current date/time is less than the expiration date/time?

Once the current date/time is greater than the expiration date/time, stop
displaying the article.

Same effect as far as your users are concerned, and you're not faced with
the frustration of, 'I need a copy of that article from 12 months ago!'

Much warmth,

Murray
---
"Lost in thought..."
http://www.planetthoughtful.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux