php - Delete a database record and associated image
I have a table of photos like this:
photo_id, photo_url, user_id
When I want to delete a photo, I need to delete the row in the table and the photo on the server. So to do this, I need to do 2 queries:
SELECTquery to return the photo's url and delete it with
DELETEquery to delete the row in the table
Is a simpler way to do this, perhaps using only one query?