Below is the code I used.
Form
- Code: Select all
<form action="adminList.php" name="form" method="POST" enctype="multipart/form-data">
<input type="file" name="files[]" multiple />
<input type="submit" value="Upload" />
<input type="hidden" name="MM_insert" value="form">
</form>
PHP
- Code: Select all
<?php require_once('Connections/dottieann.php'); ?>
<?php
$imgPath = "img/photos/listings/";
if(isset($_FILES['files'])){
foreach($_FILES['files']['tmp_name'] as $key => $tmp_name){
move_uploaded_file($tmp_name, "$imgPath{$_FILES['files']['name'][$key]}");
$path = ($_FILES['files']['name'][$key]);
$sqlst = ("INSERT INTO img (files) VALUES (".$path.")");
print_r($sqlst."<br>");
mysql_query(sprintf("INSERT INTO img (files) VALUES ('".$path."')"));
}
}
?>
and a screenshot of my table
I HAVE to be done with this project in the next couple of days or I lose the clients and I've already put 80+ hours into it. Please help this noob get around this problem!
Thanks!



