title: Export large amount of data (20000 rows) from Mysql to excel (with Php)
body: <p>I want to <strong>export</strong> large amount of data (20000 rows) from Mysql to excel (with PHP)
  data comes from two tables.
  Each record of first table have the ID of second table record.
  I am using <strong>PHPExcel</strong> Library.</p>
  
  <p>Pseudocode:</p>
  
  <pre><code>$first_table = mysql_query("SELECT * FROM table_1")
  
  foreach($first_table as $row){
  
     $store_id = $row['store_id'];
  
     $second_table =  mysql_query("SELECT * FROM table_2 Where ID = $store_id");
  
  }
  </code></pre>
  
  <p>In this case mysql query runs number of time (record found in first table)
  now problem is that it takes too long time for processing and at the end no result php screen becomes blank(white)......  I think this is execution timeout problem...</p>
  
  <p>Any solution ??</p>