title: How to perform multiple image insert and upload in PHP?
body: <p>I want to add images goa.jpg, kerala.jpg, delhi.jpg using input type 'file' as multiple. The below code is working perfectly to insert single image.</p>
  
  <p>Now I want to perform multiple image uploading using for loop but I am not getting the actual code without errors. Any one have any experience with this?</p>
  
  <pre><code>                $file_name=$_FILES["packageimage"]["name"];
                  $temp_name=$_FILES["packageimage"]["tmp_name"];
                  $imgtype=$_FILES["packageimage"]["type"];   if($imgtype!='image/jpeg'&amp;&amp;$imgtype!='image/jpg'&amp;&amp;$imgtype!='image/gif'&amp;&amp;$imgtype!='image/png'&amp;&amp;$imgtype!='image/bmp')
          {     $msg = "Please upload only Image file";   }
           else{ 
          $ext= GetImageExtension($imgtype);
                  $imagename=date("d-m-Y")."--".time().$ext;
                  $target_path = "../upload/products/".$imagename;
                  move_uploaded_file($temp_name, $target_path);
  
  // query to insert images.
  
          $query=mysql_query("insert into tbl_products set catid='".$catid."', packageimage='".$imagename."',  add_date=now()");
          if($query)
          {
          $msg="Product Added Successfull";
          }
  </code></pre>
  
  <p>When I am trying using for loop in above code it stores only first image and display only first image.</p>