2 Days :eek:
What are you doing? I though you would be resticred by the timeout setting for PHP!
Well in answer to your question, the best way i suppose would be to close an re-open the connection at set times/points in the code.
I assume it involves looping around a certian bit of code, in this case close then re-open the DB after 50 loops, then you should not see MYSQL crash or anything.