First I want to apologize that I’m not good in English and I hope you can understand what kind of help I need here…
Let say, if I have a table of product (ProductTable) as follow :
ProductId
ProductName
ProductImage
When I delete a product, I only need to define a variable pointing to image file, let say $image = “image_directory/image_filename”; then unlink this variable to delete the file image.
How if I have another table of image (ImageTable) related to ProductId as follow:
ProductId
ImageId
ImageFileName
And every product can have more than 1 images related to it.
Can anybody show me the way, when I delete one product, I also can delete all images related to it in one process?