I have a PHP page which creates a temporary directory, copies 1 file to that directory and inserts an entry in MySQL.
I want another PHP page to select all the entries in MySQL which are inserted more than 10 minutes ago, delete the files/directories and then delete the entries in MySQL.
The following code works, but it deletes only one file/directory at a time and also deletes the entry in MySQL. How can I make it delete all the selected files/directories at the same time and delete all the entries in MySQL?