Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP将sql select导出为.xls格式时数据不完整_Php_Export_Export To Excel - Fatal编程技术网

使用PHP将sql select导出为.xls格式时数据不完整

使用PHP将sql select导出为.xls格式时数据不完整,php,export,export-to-excel,Php,Export,Export To Excel,你好,我有一个问题,我从来没有过。 我有一个SQL查询,它从表中收集数据,并在web应用程序中显示完整的数据。我还有一个PHP脚本,可以将此报告导出为xls格式 我的问题是,当我将数据导出为xls格式时,最后的结果将丢失。 如果我的报告有400个结果,excel文件只有147个 这是第一次发生在我身上 您可以在下面使用我的导出功能: <?php header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cac

你好,我有一个问题,我从来没有过。 我有一个SQL查询,它从表中收集数据,并在web应用程序中显示完整的数据。我还有一个PHP脚本,可以将此报告导出为xls格式

我的问题是,当我将数据导出为xls格式时,最后的结果将丢失。 如果我的报告有400个结果,excel文件只有147个

这是第一次发生在我身上

您可以在下面使用我的导出功能:

<?php
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encodind: none');
header('Content-type: application/vnd.ms-excel; name=excel;');
header('Content-type: application/x-ms-excel;');
header('Content-Disposition: attachment;  
filename="'.basename('Reporte_egresados - '.Date("Y-m-d").'.xls').'"');
header('Content-Type: text/html; charset=UTF-8'); 
echo utf8_decode($_POST['datos_a_enviar']);
?>

如果您使用共享主机,可能是因为其他一些php限制?该web应用程序正在大学服务器上运行,我必须询问这些限制,谢谢。