Hello,
I tried to create a gallery using php admins can upload multiple images all the images are uploading correctly like the image is saving in the database as much as I can but the problem is that the image is saving once in the folder
Like loop runs images name saves in the database twice
Forexampl
img1.jpg
img2.jpg
img3.jpg
this is what comes in database but when i open the the folder i see
img1.jpg the rest are not coming
here is my code
$imggall = $_FILES["gallery_img"]["name"];
$imgtype = $_FILES["gallery_img"]["type"];
$imgtemp = $_FILES["gallery_img"]["tmp_name"];
foreach($imggall as $key => $imgname) {
$path = "./img/gallery/".$imgname;
foreach($imgtemp as $key1 => $imgtemp1) {
move_uploaded_file($imgtemp1, $path);
}
$confirm = mysqli_query($connect, "INSERT INTO gallery (image) VALUES ('$imgname')");
}