Now am trying to export MySQL database to Excel sheet and I am using PHP/MySQL to preform that and every time I get this error I've tried everything but I can't find a solutions for this case
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in staff/export.php on line 9
And here's the export.php
<?php  
//export.php  
$connect = mysqli_connect("localhost", "user", "password, "dbname");
$output = '';
if(isset($_POST["export"]))
{
 $query = "SELECT * FROM tbl_customer";
 $result = mysqli_query($connect, $query);
 if(mysqli_num_rows($result) > 0)
 {
  $output .= '
   <table class="table" bordered="1">  
<tr><th>Id</th><th>Customer name</th><th>Agent name</th><th>Phone Number</th><th>Email</th><th>Brand Name</th><th>Field</th><th>Website</th><th>comments</th></tr>
  ';
  while($row = mysqli_fetch_array($result))
  {
   $output .= '
    <tr>  
                         <td>'.$row["Id"].'</td>  
                         <td>'.$row["Customer name<"].'</td>  
                         <td>'.$row["Agent name"].'</td>  
       <td>'.$row["Phone Number"].'</td>  
       <td>'.$row["Email"].'</td>
              <td>'.$row["Brand Namel"].'</td>
        <td>'.$row["Field"].'</td>
        <td>'.$row["Website"].'</td>
         <td>'.$row["comments"].'</td>
                    </tr>
   ';
  }
  $output .= '</table>';
  header('Content-Type: application/xls');
  header('Content-Disposition: attachment; filename=download.xls');
  echo $output;
 }
}
?>
 
     
     
    