title: Simple upload multiple images in MySQL
body: <p>I'm trying to do a simple upload in my system, just with the <code>multiple="true"</code> input property.
  Actually, I have 15 file inputs, and they all rename the file name to: 'id.in.the.bd'_'number'.jpg (Ex.: 65_1.jpg). Like this:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>    // inside a form
      &lt;?php for ($x = 1; $x &lt;= 15; $x++) { ?&gt;
         &lt;input name="foto_&lt;?php echo $x; ?&gt;" type="file" id="foto" multiple="true" /&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>if ($_GET['action'] == "insert") {
  
  
  //sql insert
  
  
  // do a consult to find the $id
  $sql = mysql_query("SELECT * FROM imoveis ORDER BY id DESC LIMIT 1", $link); 
  
  $result = mysql_fetch_array($sql, MYSQL_ASSOC);
  $id = $result['id'];
  
  for ($x = 1; $x &lt;= 15; $x++) {
     $file = $_FILES["foto_" . $x];
     $path = '../../images/galeria/' . $id . '_' . $x . '.jpg';
     move_uploaded_file($file["tmp_name"], $path);
  }
  </code></pre>
  
  <p>How can I easily change my code to use the <code>multiple="true"</code>? If I just change the <code>input</code> to <code>multiple="true"</code>, he just upload the first image selected.</p>