导出的Excel文件出错

时间:2016-04-22 08:04:52

标签: php html mysql

当我尝试打开导出的文件时出现此错误,当我单击是时文件打开但在表格上方有错误:

enter image description here

<?php require '../backend/dbcon.php'; 
$query=mysql_query( "SELECT * FROM membership");
$total=mysql_num_rows($query);
if ($total>0) { $output .= '
<table border="1">
  <tr>
    
    <th>NO</th>
    <th>Names</th>
    <th>Email</th>
    <th>Phone</th>
    <th>Amount(N$)</th>
    <th>Payment</th>
  </tr>'; while ($row = mysql_fetch_array($query)) { $output .= '
  <tr>
    <td>' . $row["id"] . '</td>
    <td>' . $row["names"] . '</td>
    <td>' . $row["personal_email"] . '</td>
    <td>' . $row["personal_phone"] . '</td>
    <td>' . 110 . '</td>
    <td>' . $row["payment"] . '</td>
  </tr>
  '; } $output .= '
</table>'; 
header("Content-Type: application/xls"); 
header("Content-Disposition: attachment; filename=Membe.xls"); echo $output; }

0 个答案:

没有答案