从csv到PHP MySQL的LOAD DATA LOCAL INFILE循环

I'm trying to put together a working script to load some 1200-line CSV files into MySQL tables. The CSV files will be named sequentially in the directory I have the LOAD DATA LOCAL INFILE pointed to. It does fine loading the first file (there are three), but the last two end up with null tables (although the tables do get created). I'm trying to eventually adapt this for an n-number of data files in the future, but for now want to figure out just importing the three with a loop. Any ideas why the first file would import, but the other two return null tables?

$con=mysqli_connect("address","username","password","database");
    if(!$con){
        echo "Connection could not be established: " . mysqli_connect_error($con);
    }
    //Create Table for Sensor "n" data
    for ($i=1; $i<4; $i++){
    $table="CREATE TABLE sensor$i(Column1 VARCHAR(30), Column2 VARCHAR(30), Column3 INT, Column4 INT, Column5 INT, Column6 INT, Column7 INT)";
    if(mysqli_query($con,$table)){
        echo "Table sensor$i created successfully!";
    }
    else{
        echo "Error creating table: " . mysqli_error($con);
    }

    $file = "/Directory/sensor$i.csv"; //Load data file from local directory
    echo $file;//my debug check to output whether or not the $file was picking up unique files per loop
    $sql= "LOAD DATA LOCAL INFILE '$file' INTO TABLE sensor$i FIELDS TERMINATED BY ',' (Column1, Column2, Column3, Column4, Column5, Column6, Column7)";//Set LOAD DATA command into variable for query
    mysqli_query($con,$sql) or die(mysql_error());//Query MySQL DB to load data
}

Thanks a ton!