title: Why does my server return a 500 internal error when I do a DB query in a loop for xxxx+ times?
body: <p>This may be a silly question, but I'm curious:</p>
  
  <p>When I loop a db query a <em>ridiculous</em> (10000+) amount of times, my server returns a 500 internal error.</p>
  
  <p>I'm <em>not</em> including anything like this in any sort of app, I'm just completely curious.</p>
  
  <p>EDIT:</p>
  
  <p>Few things i forgot to mention:</p>
  
  <p>Time limit on the script has been set to infinity.</p>
  
  <p>The script actually still does all the db queries, even when the error is returned.</p>
  
  <p>The error shows up after a short while, not straight away.</p>
  
  <p>And once the error is returned, I cannot access any other page on my server for a good couple of mins (as if its frozen, and has to re-boot?)...</p>
  
  <p>I'm also on shared host...</p>