I have a form to Edit existing values in a MySQL table.
One of the fields stores the filename of an image, (another stores the folder location of the image)
The file has an upload field to upload another image and replace the image name in the original image name field.
This works fine if I choose a file, to replace the existing image.
If I don't choose to replace the image, the field is UPDATE with the empty data.
Basically I am trying to only do the UPDATE sql query if there is an image chosen and uploaded.
I am using this code:
$slick = $_FILES['file_slick']['name'];
$sql_slick = "UPDATE tbl_product SET prod_slick = '".$slick."' WHERE prod_id = '".$prodid."'";