multiple file upload sql/php

SoLiTaiRe

New Member
i am trying to upload multiple files and then insert the files names in mysql dbmy problem is with inserting the names it only store the last file name \[code\]for($i=0;$i<count($_FILES['file']['size']);$i++){ if(strstr($_FILES['file']['type'][$i], 'image')!==false){ $file = 'uploads/'.time().' - '.$_FILES['file']['name'][$i]; move_uploaded_file($_FILES['file']['tmp_name'][$i],$file); $na=$_FILES['file']['name'][$i]; $sql="INSERT INTO img (img_name) VALUES ('$na');"; }}\[/code\]notice that all the files are uploaded successfully
 
Top