D
D
Dmitry2014-05-29 13:51:54
PHP
Dmitry, 2014-05-29 13:51:54

How to delete data from the database after a certain time?

The data is written to the database. It is necessary after a certain time to delete this entry if certain data (request) has not been received. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2014-05-29
@Rsa97

Put a timestamp on records and delete old data when starting the script that uses them (that is, first DELETE ... WHERE timestamp < DATE_SUB(NOW(), INTERVAL 15 MINUTE), and then SELECT).

S
Sergey Savostin, 2014-05-29
@savostin

If MySQL is rooted, then CREATE EVENT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question