 |
|
Code (PHP)
mkdir("uploads/$userid");
$uploadFolder = "uploads/$userid/";
foreach ($_FILES['imageFile']['tmp_name'] as $key => $image) {
$imageTmpName = $_FILES['imageFile']['tmp_name'][$key];
$imageName = $_FILES['imageFile']['name'][$key];
$sql = "SELECT * FROM images where imgName = '$imageName' ";
$query = mysqli_query($con, $sql);
$ck = mysqli_num_rows($query);
if ($ck <= 0) {
$result = move_uploaded_file( $imageTmpName , $uploadFolder.$img);
// save to database
$sql = "INSERT INTO images(userid,imgName,roomtype,jobtype,list,statusjob) VALUES ('$userid','$imageName','-','-','-','9')";
$query = mysqli_query($con, $sql) or die("Error in query: $sql " . mysqli_error());
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2021-05-23 16:46:07 |
By :
gogo51478 |
View :
595 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |