class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
if (array_key_exists(0, $uploaded))
$mpic[1]=", pic1='".$msc0.$uploaded[0]['large']."'";
if (array_key_exists(1, $uploaded))
$mpic[2]=", pic2='".$msc1.$uploaded[1]['large']."'";
if (array_key_exists(2, $uploaded))
$mpic[3]=", pic3='".$msc2.$uploaded[2]['large']."'";
So that you are updating ONLY the fields which have an image uploaded.
Note that you will also have to change this line
$uploaded[] = $this_upload;
into something like:
$n++;
$uploaded[$n] = $this_upload;
so that each picture from $_FILES has proper key.
Please contact me privately should you want more information. This is a basic PHP/MySQL problem, and has nothing to do with this forum.Reply
Even if some images are not uploaded, you are still updating the database! You always update the three image fields in your query.
This code below:
Should be something like:
So that you are updating ONLY the fields which have an image uploaded.
Note that you will also have to change this line
into something like:
so that each picture from $_FILES has proper key.
Please contact me privately should you want more information. This is a basic PHP/MySQL problem, and has nothing to do with this forum.