我正在尝试在php和amp;中运行一段代码mysql使用PHPExcel生成excel文件(.xlsx)。在服务器中运行此代码时出错

时间:2017-09-22 06:12:00

标签: phpexcel

请帮我解决这个问题以识别此代码中的错误我将非常感谢你。 这是我的代码

`

<?php

require_once('../_inc/dbConnect.php');
//echo "i";
require('PHPExcel/Classes/PHPExcel.php');
//echo "i1";

$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$rowCount = 1;
//echo $rowCount;
//echo "i";
$query = "select * from M_FARMER_DETAILS";  
$result = mysqli_query($con, $query);
while($row = mysqli_fetch_assoc($result)){
    $objPHPExcel->getActiveSheet()->SetCellValue('A'.$rowCount, $row['F_NAME']);
    $objPHPExcel->getActiveSheet()->SetCellValue('B'.$rowCount, $row['F_ADDRESS']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.$rowCount, $row['F_MOBILE']);   
    $objPHPExcel->getActiveSheet()->SetCellValue('D'.$rowCount, $row['F_AADHAR']);
    $rowCount++;
}
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save('some_excel_file.xlsx');
*/
?>`

0 个答案:

没有答案