how to upload multi images of a single product

Viewed 53

I'm confused about how to upload a lot of images to a single product like

someone wants to publish a product and chose images of it how I can do that using PHP and MySQL

or if there is another way

for example, I want to create a website where anyone can publish a car with its information and photos

is it possible to insert a lot of image links into a single column in MySQL

I want to use drag and drop for uploading them

enter image description here

1 Answers
if(isset($_POST['submit'])){

  $countfiles = count($_FILES['file']['name']);
  for($i=0;$i<$countfiles;$i++){
    $filename = $_FILES['file']['name'][$i];
    move_uploaded_file($_FILES['file']['tmp_name'][$i],'upload/'.$filename);
  }
} 

for the drag and drop you can use JS this could help you

Related