gwynevere
10-20-2008, 03:31 AM
Right now, I'm using this code on my site:
$killtime = "(NOW() - 32000)";
mysql_query("DELETE FROM status WHERE time < $killtime") or die(mysql_error());
It works, but the problem is that it deletes EVERYTHING old AND new mysql entries for some reason. What I want is for it to delete old messages that are three days old and of course keep the newer ones. I read on google that it is probably easier to set up a cron job to do this, but I don't have any knowledge about cron jobs.
What would my php script be (one that works properly), and what command do I enter in the Cron Jobs in CPanel.
Thanks!
$killtime = "(NOW() - 32000)";
mysql_query("DELETE FROM status WHERE time < $killtime") or die(mysql_error());
It works, but the problem is that it deletes EVERYTHING old AND new mysql entries for some reason. What I want is for it to delete old messages that are three days old and of course keep the newer ones. I read on google that it is probably easier to set up a cron job to do this, but I don't have any knowledge about cron jobs.
What would my php script be (one that works properly), and what command do I enter in the Cron Jobs in CPanel.
Thanks!