delete images

Discussion in 'Coding Help' started by louie, Mar 15, 2006.

  1. louie

    louie New Member

    ok PHP heads, I need some advice on this.

    I am after adding new products to the database and also have some discontinued cause they are not available anymore.

    To delete those products in one shot is easy through php, but i'll be left with a lot of images on the server that i don't use anymore.

    in the database i have the path to both sized images (small, large), so by looping through them, i can get the path for it but i need to delete those from folders before the record itself.

    any example or good reading material?
     
  2. louie

    louie New Member

    got it guys. thanks.
     
  3. mneylon

    mneylon Administrator Staff Member

    You could possibly store the images directly in the DB?
     
  4. louie

    louie New Member

    you must know that is a bad ideea. images will take a lot a space in the database for no reason.
    php has a function "unlink" which was just what i wanted. use within the loop function to delete data from the database i can also get the images deleted from the root folder.
     
  5. mneylon

    mneylon Administrator Staff Member

    Louie

    Maybe, but I might not be that concerned with space :)
     
  6. louie

    louie New Member

    somebody is in a good mood today.
    maybe you don't care, but others do, and since i start working on websites i learned that is a bad ideea to store blob data in the database.
     
  7. mneylon

    mneylon Administrator Staff Member

    Ah Louie - you don't need to be so touchy :)

    PhpAdsNew stores images in its DB and I've been using that for ages
     
  8. louie

    louie New Member

    touchy? who me? miles away from it.
    i am a happy camper man.
     

Share This Page