Php can';从数据库中设置CellValue,但静态值有效吗?
我正在使用此代码从数据库中设置cellvalue,但它不起作用Php can';从数据库中设置CellValue,但静态值有效吗?,php,Php,我正在使用此代码从数据库中设置cellvalue,但它不起作用 $excel2 = PHPExcel_IOFactory::createReader('Excel2007'); $excel2 = $excel2->load("test.xlsx"); // Empty Sheet $excel2->getActiveSheet()->setCellValue('A1', 'Date'); $m=2; $result=mysqli_
$excel2 = PHPExcel_IOFactory::createReader('Excel2007');
$excel2 = $excel2->load("test.xlsx"); // Empty Sheet
$excel2->getActiveSheet()->setCellValue('A1', 'Date');
$m=2;
$result=mysqli_query($con,"select * from settings");
while($row=mysqli_fetch_array($result))
{
$chan=$row['channelID'];
$excel2->getActiveSheet()->setCellValue("C$m", $chan);
echo $chan;
echo "<br>";
$m++;
}
我不知道我哪里做错了,我想从数据库中设置值
如果有任何帮助,我们将不胜感激。您从查询中得到任何结果吗?是的,我得到了值,但我无法使用这些值设置CellValues。您确定
$row['channelID']
有值吗?是的,它在我回显时显示值,但无法设置为cell value?
$excel2->getActiveSheet()->setCellValue("C$m", "static text");