This is a new area to me within PHP. I'm gearing up for a new role in which PHP will be at my disposal to automate some reporting on some very large DBs. I'll be dumping some CSVs out in which the queries to run and fully export the file will most likely run 20+ minutes.

I'm a complete beginner when it comes to understanding how PHP handles output while its still running. I'm curious, when using mysql_unbuffered_query(), is the script going to timeout at the set time limit? If so what are my options? SHould I be jacking the PHP timeout up to 2 hours? I'll also want to be able to retrieve task progress while it is running, what options might I have for this?

What might some error handling look like for this?