I want to update multiple image in php in database store this image as string format 2.png,3.png,8.png like this now i want to update that image issue am facing is when try to update with that image when i put empty image it took also empty image what should i have to do this is my code
for ($i = 0; $i < count($_FILES['files']['name']); $i++)
{
// echo "hello";
// echo $i;
$finalcnt=$i;
$temp = $_FILES["files"]["tmp_name"][$i];
$name = $_FILES["files"]["name"][$i];
// if(empty($name))
$stmt = $con->query("SELECT imgName FROM multiple where id=18 ");
$row = $stmt->fetch_assoc();
$getname=$row['imgName'];
$covrt=explode(",",$getname);
$hello = $_FILES["files"]["name"];
$jjjjjgg=implode(",",$hello);
if($i == 0){ $err = "File uploaded successfully"; $cls = "success"; }
move_uploaded_file($temp,"uploads/".$name);
$after_implode= implode(",",$hello);
}
print_r($covrt);//old array list
print_r($hello);//New array list
for ($i = 0; $i < count($_FILES['files']['name']); $i++)
{
// echo "hello";
// echo $i;
$finalcnt=$i;
$temp = $_FILES["files"]["tmp_name"][$i];
$name = $_FILES["files"]["name"][$i];
// if(empty($name))
$stmt = $con->query("SELECT imgName FROM multiple where id=18 ");
$row = $stmt->fetch_assoc();
$getname=$row['imgName'];
$covrt=explode(",",$getname);
$hello = $_FILES["files"]["name"];
$jjjjjgg=implode(",",$hello);
if($i == 0){ $err = "File uploaded successfully"; $cls = "success"; }
move_uploaded_file($temp,"uploads/".$name);
$after_implode= implode(",",$hello);
}
Thank You In Advanced
I tried with may time