I have a php script that runs daily from a cron job, to unzip a large zip file containing text data and save this back to a mySQL database.
The zip file is updated and uploaded daily to the FTP site where the php file is hosted.
This has all worked 100% fine for several months, but I think recently our hosting has upgraded itself to PHP version 5.6, and now I get these errors:
Error populating table: The used command is not allowed with this MySQL version
The code that populates the mySQL table is this:
$loadfile = "LOAD DATA LOCAL INFILE '$textfile' INTO TABLE $tablename FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n' IGNORE 1 LINES";
mysqli_query($conn, $loadfile)
What I really dont understand is that sometimes it seems to run ok and sometimes it fails! Maybe once a week it works ok now, and on all other days it fails.
Has something changed in PHP that means the above code is now wrong?
Can anyone help with the above code to get it running reliably on PHP 5.6?