Php & Mysql Image updating and deleting -


i creating simple employee management system practicing php & mysql. admin can add, edit & delete staffs, admin can upload image every employees

i know how upload images but, how update uploaded images, example admin wants change profile image of staff? don't want delete old image should there , front page should show updated new image, admin can view , delete images of staffs seperate page..

the profile page profile.php show details of employee including profile image. know how create this. in page there link called view images go profile_images.php?id=users id undeleted old images should shown here.

how design database thing..

currently database looks http://i61.tinypic.com/5eyej6.jpg

looking help.. :)

you should store 1 path/filename profile pic in database table. if upload new 1 need replace old filename new filename , image replaced.

if want store 'old' images, there no magic fix. have build using logic.

  • when uploading image
    • if 1 exists
      • copy existing image filename new table, user id
  • process new image , store new filename

then can display 'old' images, separate table, if exist, , regardless of how many there are, keeping 'main' image in main table.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -