Right. Your PHP script would look something like this:
<?php // delete_old.php
// connect to db here...
$expired = date("Y-m-d", strtotime("-15 days"));
$query = "DELETE FROM table WHERE date_col < '$expired'";
mysql_query($query);
?>
On the commandline, you would execute this by:
php -q delete_old.php
strtotime() creates a UNIX timestamp based on a string representation. We create the timestamp for 15 days ago. We use date() to format it into YYYY-MM-DD format, which is how MySQL stores items in DATE columns. (DATE is a MySQL data type).
More info:
http://www.php.net/strtotime
http://www.php.net/date
Take care,
Nik
http://www.bigaction.org/