frank_solo Posted October 20, 2011 Share Posted October 20, 2011 Not sure if I wrote this correctly but if anyone can just scan through this and let me know if it's fine. Thanks <?php $db_link=mysql_connect ("localhost", "", "") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("commercial"); $sql = "DELETE FROM `comm` WHERE `date_created` < DATE_SUB(NOW(),INTERVAL 14 DAY)"; $result2 = mysql_query($sql, $db_link); ?> Link to comment https://forums.phpfreaks.com/topic/249431-cron-job-to-delete-data-after-14-days/ Share on other sites More sharing options...
MasterACE14 Posted October 20, 2011 Share Posted October 20, 2011 test it and find out? Link to comment https://forums.phpfreaks.com/topic/249431-cron-job-to-delete-data-after-14-days/#findComment-1280733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.