php - Delete a database record and associated image -
i have table of photos this:
photo_id, photo_url, user_id
when want delete photo, need delete row in table , photo on server. this, need 2 queries:
- a
select
query return photo's url , deleteunlink()
- a
delete
query delete row in table
is simpler way this, perhaps using 1 query?
your way best way this....how can simpler....
also, if photos use ids may delete row instead of selecting query return photos url. if successful proceed deleting thumbnail
Comments
Post a Comment