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:
- A
SELECT
query to return the photo's url and delete it withunlink()
- a
DELETE
query to delete the row in the table
Is a simpler way to do this, perhaps using only one query?