"No data received" error when I have a mysql query in while loop
<p>I have this PHP code:</p>

<pre><code>&lt;?php
    include_once("connect_to_mysql.php");

    $max=300;
    while($max--)
    {
        sleep(1);
        doMyThings();
    }
?&gt;
</code></pre>

<p>it is supposed to repeat a mysql query 300 times with gap of 1 second between each. But the problem is after a minute or so in the browser i get this message:  No Data Received. Unable to load the webpage because the server sent no data. </p>
