title: SQL queries results write to Excel
body: <p>OK so I have no Idea how to do this except install PHPexcel</p>
  
  <p>But say I have the results of a query in an array</p>
  
  <pre><code>$mysqli = new mysqli('server', 'user1', 'pass', 'users');
  if ($mysqli-&gt;connect_error)
       die(connect error ('.$mysqli-&gt;connect_error.') '.$mysqli-&gt;connect_error);
  
  $date = date("Y-m-d");
  $query = "SELECT * from usr WHERE date = '$date'";
  while($row = $query-&gt;fetch_array()) {
       //EXCEL STUFF???
  }
  </code></pre>
  
  <p>And then how would I write this to an excel spreadsheet?
  Any help appreciated</p>