2008/5/27 Stefano Esposito <ragnarok@xxxxxxxx>: > Hi all, > > i'm wandering if there's some intelligent way to delete old records > from a mysql table without using cronjobs (i can't), using PHP. > This table has a field which stores the value returned from time(), and > i want to do > > mysql_query("DELETE FROM `table` WHERE `time`<='".(time()-86400)."'"); > > at periodical intervals (say every 15 hours). Thanks for any hint :) What version of MySQL? If it's >= 5.1.6, you can use the mysql event scheduler. http://dev.mysql.com/tech-resources/articles/event-feature.html http://dev.mysql.com/doc/refman/5.1/en/events.html -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php