title: When i try to generate Excel Report using PHP, values not getting generated,
body: <p>When i try to generate Excel Report using PHP, values not getting generated, I need to loop the mysqli_stmt_bind_result to excel file using while fetch</p>
  <pre><code>    mysqli_stmt_bind_result($setRec, $emp_no, $emp_name, $designation, $location, $attend_date);
      mysqli_stmt_store_result($setRec);
      $resultCheck2 = mysqli_stmt_num_rows($setRec);
      echo &quot;result num_rowsss = $resultCheck2 \n&quot;;
              
      // $setRec = mysqli_query($link, $setSql);
      
      $columnHeader = '';
      $columnHeader = &quot;Emp No&quot; . &quot;\t&quot; . &quot;Emp Name&quot; . &quot;\t&quot; . &quot;Designation&quot; . &quot;\t&quot; . &quot;Location&quot; . &quot;\t&quot; . &quot;Date&quot; . &quot;\t&quot; . &quot;Attendance&quot; . &quot;\t&quot; . &quot;Over Time&quot; . &quot;\t&quot;. &quot;Remarks&quot; . &quot;\t&quot;;
      
      $setData = '';
      
      while ($rec = mysqli_stmt_fetch($setRec)) {
          $rowData = '';
          foreach ($rec as $value) {
              $value = '&quot;' . $value . '&quot;' . &quot;\t&quot;;
              $rowData .= $value;
          }
          $setData .= trim($rowData) . &quot;\n&quot;;
      }
      
      $filename = &quot;Attendance_Reoprt.xls&quot;;
      $FN = $pdate.'_'.$filename;
      
      header(&quot;Content-type: application/octet-stream&quot;);
      header(&quot;Content-Disposition: attachment; filename=$FN.xls&quot;);
      header(&quot;Pragma: no-cache&quot;);
      header(&quot;Expires: 0&quot;);
      
      echo ucwords($columnHeader) . &quot;\n&quot; . $setData . &quot;\n&quot;;
      
      mysqli_close($link);
  }
  </code></pre>