Bufferering or background task ? .. help !
I have a script that calls another one which has a loop that reads a huge file (mine actualy 14 Mb) and reads it line by line (actualy 55000), parses them and makes an INSERT in a MySQL database.
The file can even be larger ...
At start of script i display a short info and normaly each time an error is detected in a line, it should diplay a warning.
At the end of script, i display the result : number of line inserted and number of errors.
If everything works ok on small files (about several thousand of lines) i do have a problem on large files. The execution time (70-80 s) is beyond time out of server and browser. It also depends on what server it runs.
In some configuration, nothing is displayed until end of script, with others the begining is displayed than nothing, sometimes it timeouts and nothing is done.
How can i make the script run in background and/or display a progress bar or something that would warn the client that something happens ?
I tried to send a == to the browser at x loops but that does not solve my problem. I tried to optimize evrything i could in parsing and MySQL command... (can't use LOAD DATA INFILE due to server restrictions)
Every help is welcome.
A happy new year to all readers.