title: What is the best way to display a large set of data (PHP)
body: <p>I have a function that connect to about a 1000+ databases and get the data back and put it in an array.</p>
  
  <p>however, the data is so large and I want to display the results on the browser each time the loop goes through a connection  instead of waiting for the whole loop to finish.</p>
  
  <p>or if there is a better way of doing so, please share.</p>
  
  <pre><code>function Get_data()
  {
   // loop base on the number of available databases
      for ($i = 0; $i &lt; count($client_databases); $i++) {
  
          // Getting connection for each database
          $database = $this-&gt;connect_clients_db($client_databases[$i]);
  
         // return an array of data from the database
          $ClientShema = $this-&gt;getSomeData($database);
  
          // put the data in array
           $schemas[]=$ClientShema;
      }
  
  
       return $schemas;
  
  
  }
  </code></pre>
  
  <p>example of results would be</p>
  
  <p>loop  1 (database_one)
  this is a data coming from database one</p>
  
  <p>loop 2 (database_two)
  this is a data coming from database two</p>