使用mysqli将文件上传到数据库

这是我的代码,但是不起作用,我不知道为什么...

$conn = mysqli_connect($servername, $dBUsername, $dBPassword, $dBName);
$conn->set_charset("utf8");
if (!$conn) {
    die("Error: " . mysqli_connect_error());
}

if (count($_FILES["file"]["name"]) > 0) {
    sleep(3);
    for ($count = 0; $count < count($_FILES["file"]["name"]); $count++) {
        $file_name = $_FILES["file"]["name"][$count];
        $tmp_name = $_FILES["file"]['tmp_name'][$count];
        $file_array = explode(".", $file_name);
        $file_extension = end($file_array);
        if (file_already_uploaded($file_name, $connect)) {
            $file_name = $file_array[0] . '-' . rand() . '.' . $file_extension;
        }
        $location = '../../uploads/' . $file_name;
        if (move_uploaded_file($tmp_name, $location)) {
            $sql = "INSERT INTO soubory (image_name, image_description) VALUES ('" . $file_name . "', '')";
            $result = $conn->query($sql);
        }
    }
}

function file_already_uploaded($file_name, $connect)
{
    $sql = "SELECT * FROM soubory WHERE image_name = '" . $file_name . "'";
    $result = $conn->query($sql);
    $number_of_rows = $result->rowCount();
    if ($number_of_rows > 0) {
        return true;
    } else {
        return false;
    }
}

HTML:

<input type="file" name="multiple_files" id="multiple_files" multiple />

当我尝试上传一些图像时,它什么也没有发生...在将其与PDO一起使用之前,但是现在在mysqli中它不起作用...