title: Can't Export to Excel using Php7 and Mysql
body: <p>I need to import mysql datas to an excel file. I'm using php7. I wrote a code but the problem is all the data are printed in a single column in excel file. Could anyone help me with code to change the row and column in excel file.
  This is my code:
         `
  
  <pre><code>$connect=  mysqli_connect("localhost", "root", "", "crmweb");
  $output='';$output2='';
  
      $sql="SELECT name,hname,cno FROM hencus ";
      $result=  mysqli_query($connect, $sql);
      if(mysqli_num_rows($result)&gt;0)
      {
          $output.=' 
                  &lt;table class="table" border="1&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;House&lt;/th&gt;
                      &lt;th&gt;Contact&lt;/th&gt;
                      &lt;/tr&gt;';
          while($row= mysqli_fetch_array($result))
          {
              $output.=' 
  
                  &lt;tr&gt;
                      &lt;td&gt;'.$row['name'].'&lt;/td&gt;
                      &lt;td&gt;'.$row['hname'].'&lt;/td&gt;
                      &lt;td&gt;'.$row['cno'].'&lt;/td&gt;
                      &lt;/tr&gt;';
  
          }
          $output.='&lt;/table&gt;';
  
          header("Content-Type: application/xls");
          header("Content-Disposition: attachment; filename=download.xls");
          echo $output;
         // echo $output2;
  
  
      }
  
      ?&gt;      `      
  </code></pre>