title: Upload Multiple Files in PHP & INSERT path to MySQL
body: <p>I've setup a form to upload multiple files from a PHP script and then insert it into the Database with path. Here's my code </p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
  &lt;tr class='first'&gt;
      &lt;td&gt;Property Image : &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="file" name="pic_upload[]" &gt;
          &lt;input type="file" name="pic_upload[]" &gt;
          &lt;input type="file" name="pic_upload[]" &gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class='first'&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="create" value="Add"  /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;?php
  if(isset($_POST['create'])) {
      $path = "images/";
      for ($i=0; $i&lt;count($_FILES['pic_upload']['name']); $i++) {
          $ext = explode('.', basename( $_FILES['pic_upload']['name'][$i]));
          $path = $path . md5(uniqid()) . "." . $ext[count($ext)-1]; 
          move_uploaded_file($_FILES['pic_upload']['tmp_name'][$i], $path);
      }
      $sql = "INSERT INTO post (`image`) VALUES ('$path');";
      $res = mysqli_query($con,$sql) or die("&lt;p&gt;Query Error".mysqli_error()."&lt;/p&gt;");
      echo "&lt;p&gt;Post Created $date&lt;/p&gt;";
  }
  ?&gt;  
  </code></pre>
  
  <p>The Script runs successfully, but at the database end inside the column it looks like this.</p>
  
  <p>images/8de3581eb72ee7b39461df48ff16f4a3.jpg024fae942ae8c550a4bd1a9e028d4033.jpg380cc327df25bc490b83c779511c015b.jpg</p>
  
  <p>Help me out with this please</p>