$result = mysql_query("DELETE FROM tags WHERE timeofvi < now() - interval 2 MONTH"); // delete by time