jagguy Posted July 30, 2007 Share Posted July 30, 2007 I want to delete all timstamp entried older than 2 days. This fails to delete do anything and there is no error. The field name is date and table name is logbook $sql="Delete from logbook where TIMESTAMPDIFF(DAY, 'date', NOW()) > 2 " ; Link to comment https://forums.phpfreaks.com/topic/62450-delete-old-timestamp/ Share on other sites More sharing options...
hitman6003 Posted July 31, 2007 Share Posted July 31, 2007 DELETE FROM logbook WHERE date < DATE_SUB(NOW(), INTERVAL 2 DAY); Link to comment https://forums.phpfreaks.com/topic/62450-delete-old-timestamp/#findComment-311524 Share on other sites More sharing options...
clearstatcache Posted July 31, 2007 Share Posted July 31, 2007 try ds... DELETE FROM logbook WHERE unix_timestamp(date) < (unix_timestamp(current_timestamp()) - 172800); Link to comment https://forums.phpfreaks.com/topic/62450-delete-old-timestamp/#findComment-311676 Share on other sites More sharing options...
jagguy Posted July 31, 2007 Author Share Posted July 31, 2007 This works on my mysql DB Delete from logbook where TIMESTAMPDIFF(SQL_TSI_DAY, date, NOW()) > 2 Link to comment https://forums.phpfreaks.com/topic/62450-delete-old-timestamp/#findComment-311723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.