Is it possible to delete a file if there is no reference to it in the database using mySQL

2

I would like to know if anyone knows of any way to create a "trigger" in MySQL that deletes a value from the table, delete a file together on the server, for example:

  • Exclude the item from tbl_imagens whose name is imagem_1001.jpg ;
  • The trigger takes the imagem_1001.jpg value and deletes it in the uploads/imagem_1001.jpg
  • Note:

    • I'm not interested in saving images to the database;
    • I'm not interested in deleting with PHP unlink() ;
    asked by anonymous 15.04.2015 / 15:38

    0 answers