Not working in move_uploaded_file for For Loop
<pre><code>for($i=0;$i&lt;count($sentto1);$i++)
 {           
 $sel="insert into newmessage set sendto='".$sentto1[$i]."', 
                                  sendfrom='".$almemailid."',
                                  subject='".$subject."',
                     message='".$color."',
                     attac='".$fileatt_name."', 
                     updateddate = now()";

      $selqur=mysql_query($sel) or die("Error (" . mysql_errno() .")" . mysql_error());
      $lastid_id = mysql_insert_id();
     $folderpath = "Attachment/".$lastid_id."".$fileatt_name;
     move_uploaded_file($_FILES["attachcopy"]["tmp_name"],$folderpath);
  } 
</code></pre>

<p>Please help me.
In the above program move_uploaded_file works well in single iteration,
how i insert multiple file to store in folder (Folder Name:Attachment)</p>
