Posted by trawets on 11/08/07 21:25
Hi
I am trying to write something which will enable me to run a php
script from cron which will delete news item entries from a mysql db.
Criteria here is that the script would look at a field 'publish_down'
which has this format '2007-01-29 16:00:08' check this date is passed
and then delete if it is more than 90 days older.
I have tried to come up with something but a little advise would be
grateful
$today = date("Y-m-d", publish_down("-90 days"));
mysql_query("DELETE FROM table WHERE date = '$today'") or
die(mysql_error());
(publish_down = a table field which is a date)
how would I adopt this type of query into php script
please
trawets
Navigation:
[Reply to this message]
|