If data type is MySQL Timestamp, Datetime:
DELETE
FROM my_table
WHERE time_created < (NOW() - INTERVAL 10 DAY);
If data type is UNIX Timestamp:
DELETE
FROM my_table
WHERE time_created < (UNIX_TIMESTAMP() - 600);
Note that UNIX Timestamp in second, statement above meaning 600 seconds => 10 minutes
No comments:
Post a Comment