svgmx5 Posted July 20, 2010 Share Posted July 20, 2010 What i have is a form where users can upload various images into the server. The problem is that the images are not being uploaded into the server folder. They are added to the database, but not to the server Here's the code that i have <?php if(isset($_POST['submit'])){ $target = 'images/test/'; for ($l = 0; $l <= 1000; $l++){ $dir = $target.$_FILES['file_'.$i]['name']; move_uploaded_file($_FILES['file_'.$i]['tmp_name'], $dir); } $query = "INSERT INTO project_images (imageURL) VALUES "; $inserts = array(); for ($i = 0; $i <= 1000; $i++){ if (isset($_FILES['file_'.$i]['name'])){ $inserts[] = "('".$_FILES['file_'.$i]['name']."')"; } } if (count($inserts) > 0){ $query .= implode(', ', $inserts); $result = mysql_query($query) or die(mysql_error()); } } ?> I don't get any errors at all Hope someone can help Link to comment https://forums.phpfreaks.com/topic/208259-need-help-with-this-script-for-multiple-image-uploads-to-db/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.