Delete documents automatically

0

currently I have a doubt, I have a small server which I upload documents using a form, this is uploaded, is the record of the time which has been uploaded and when it should be deleted, I would like to know if there is any simple way to delete the file following the mechanics of using php or js (the database is mysql on linux server).

    
asked by Nicole 09.05.2018 в 18:30
source

1 answer

1

If you can by php you can get the current day of the server with the function date("Y-m-d H:i:s") , to get the current day of the server do a delete

DELETE FROM table_name
WHERE columna_fecha_borrar = Variable_obtenida

where columna_fecha_borrar is the field of the database and the obtained variable is the one that contains the date and time captured from the server

Clearly, a connection of the php code to the database is necessary

here is a link to delete a MySql file

Link: php_mysql_delete

    
answered by 09.05.2018 в 18:45