add a field to your table to hold the time function
$value = time();
Then, the next time the script runs, you place before any SQLs to grab data the following:
$postdate = time()-2592000;
$sql = mysql_query("DELETE FROM tablename WHERE postdate < '$posdtate' ") or die (mysql_error());