So I have a php file that runs sets of sql queries for a list of ids. This file may take some time to run.
While that is running, I want to have a progress bar.
I have it so that the running file updates a session variable indicating the percentage of completion after each set of queries. Then in my front end, I'm doing an ajax call to another file that reads the session variable value and returns it. I then update the width of the progressbar fill with the returned percentage.
The problem: The progress bar isn't updated until the all the queries are completely done. So I see my progress bar at 0% for some seconds then it suddenly jumps to 100%. It seems that the session is locked until the script completes. I tried using session_write_close() but cannot get it to work.
Thanks.