I recently experienced a problem with a complex MySQL query which reported “MySQL server has gone away” and then just stopped.
There are plenty of posts with suggestions to help you fix this rare but annoying message and it’s likely they will help you more than this post. However I found a solution, and one that I could replicate so that for my particular issue have conclusive evidence of the cause. An unusual luxury.
Remove flush()
It is as simple as that. If you find flush() is called at any time while processing a page that suffers this error, rem it out and try again. More information on flush() can be found here: http://uk3.php.net/flush






