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
SELECTquery to return the photo's url and delete it withunlink() - a
DELETEquery to delete 开发者_JAVA百科the row in the table
Is a simpler way to do this, perhaps using only one query?
Your way the best way to do this....How can it be simpler....
Also, if your photos use ids then you may just delete the row instead of selecting the query to return to the photos URL. then if this is successful proceed with deleting the thumbnail
加载中,请稍侯......
精彩评论