title: Fatal error: Allowed memory size- PHP expert advice needed
body: <p>Hello
  I have a PHP program with my own classes. I am using a Xampp server in the office. </p>
  
  <p>It has 4 basic parts: 
  1)The program reads one mysql record ("SELECT a, b, c....
  then loops a few times to total.</p>
  
  <p>2) echo some variables to the screen (about 10) </p>
  
  <p>3) Insert a record into a second mysql file (summary of the first group)</p>
  
  <p>4) Clear variables (30 or so) </p>
  
  <p>Now I have read many pages on this topic including about 15 here. I know I can up the memory, but that is not the solution I am looking for. 
  I now have about 3,000 records in the first database and I expect it to grow 1000x that. </p>
  
  <p>I have years of programing experience and can see the problem. In a language like "c" when you do this kind of loop, the results are displayed immediately. But with  PHP it cycles and nothing is displayed until the operation is over or it stops like here. I know that is filling up the memory. I could not display any variables, but it might be difficult to debug. </p>
  
  <p>So how do I resolve this? I looked at flush() and  ob_flush(). Is that what is needed so this does not all accumulate in memory?</p>
  
  <p>Thank You in advance</p>
  
  <p>.
  .</p>