Therefore the update page includes an <input type="file"> field to allow them to choose a different image.
The problem is, that if the user does not want to change the image and leaves this field blank, when they press the submit button, it updates the database and removes the name of the previous image the user had uploaded.
There are 5 images in the update form.
Here is the update code I have at the moment:
Expand|Select|Wrap|Line Numbers
- $sql = "UPDATE businesslistingtb SET companyname='$companyname', address='$address' , postcode='$postcode' ,
- contactname='$contactname' , contactnumber='$contactnumber' , email='$email' , businesstype='$businesstype' , businesshours='$businesshours'
- , whatsunique='$whatsunique' , logo_image='$imagename', testimonial1text='$testimonial1text' , testimonial1who='$testimonial1who' ,
- testimonial2text='$testimonial2text' , testimonial3text='$testimonial3text' , products='$products' , services='$services' , awards='$awards'
- , directions='$directions' , paymentmethods='$paymentmethods' , additionalinfo='$additionalinfo' , gallery_image1='$gallery_image1_name' ,
- gallery_image2='$gallery_image2_name' , gallery_image3='$gallery_image3_name' , gallery_image4='$gallery_image4_name' WHERE userid=$id";
Any help much appreciated!
Paul