Insert date into phpmyadmin : I have the following php code :

    <?php
    require_once ('./db.php');
    
    $conn = mysqli_connect($servername, $username, $password, $db ,$port);
    $dir = "Files";
    $files = array_diff(scandir($dir), array(".","..")) ;
    //error_log(count($files));
    for($i = 2 ; $i < count($files)+2 ; ++$i){
        $d = date ("Y-m-d", filemtime("Files/".$files[$i]));
        //error_log($d);
        $insertFilesQuery = "INSERT INTO fichier (Name,Modified) VALUES ('".$files[$i]."','".$d."')";
        $resultInsert = mysqli_query($conn,$insertFilesQuery);
        //sleep(2);
        
    }
    ?>

I want to get all the files in a directory and add their name and last modified date (yyyy-mm-dd) into mysql db.
The table fichier has 4 columns : Id, Name, Modified, OwnerId, with the type of Modified being a DATE.
The code runs with no errors but nothing is inserted into the db.
Any help would be appreciated.