2017-05-14 7 views
1

この予期しないファイルエラーの末尾があり、エラーの位置を特定することができます。予期せぬファイルエラーの終了、誰でも教えて/コードを提案することができます

<?php 
$connect = mysqli_connect("localhost", "root", "", "funrun"); 
$output = ''; 
if(isset($_POST["export_excel"])) 
{ 
    $sql = "SELECT * FROM registered ORDER BY fname DESC"; 
    $result = mysqli_query($connect, $sql); 
    if(mysqli_num_rows($result) > 0) 
    { 
     $output .= ' 
      <table class="table" bordered="1"> 
       <tr> 
        <th>First Name</th> 
        <th>Middle Name</th> 
        <th>Last Name</th> 
        <th>Address</th> 
        <th>Age</th> 
        <th>Gender</th> 
        <th>BIB NO.</th> 
        <th>Category</th> 
       </tr> 
      '; 
      while($row = mysqli_fetch_array($result)) 
      { 
       $output .= ' 
       <tr> 
        <td>'.$row["fname"].'</td> 
        <td>'.$row["mname"].'</td> 
        <td>'.$row["lname"].'</td> 
        <td>'.$row["address"].'</td> 
        <td>'.$row["age"].'</td> 
        <td>'.$row["gender"].'</td> 
        <td>'.$row["bib_no"].'</td> 
        <td>'.$row["category"].'</td> 
       </tr> 
      '; 
     } 
     $output .= '</table>'; 
     header("Content-Type: application/xls"); 
     header("Content-Disposition: attachment; filename=download.xls); 
     echo $output; 
    } 
} 
?> 

誰もが(まだここ学習)コメントしてください

+0

これはphpMyAdminにとしなければならない

header("Content-Disposition: attachment; filename=download.xls);をすべきですか? – Barmar

+0

またはExcel、またはHTML?これはPHPの構文エラーで、他のアプリケーションや技術とは関係ありません。 – Barmar

答えて

1

提案やコメントを得たあなたは)(あなたのヘッダーに '"' を失いました。

header("Content-Disposition: attachment; filename=download.xls"); 
+1

私の目はぼやけています。Dところでありがとう。 –

+0

私はそれが助けてうれしい –

関連する問題