我从数据库
导出csv中超过500行的ERROR 500 - INTERNAL SERVER ERROR
在php.ini和页面上将max_execution_time增加到240,然后也是错误
if(isset($_POST['export1']) || !empty($_POST['$row[id]']))
{
$filename ="excelreport.xls";
include('include/conectdb.php');
$q3 = "SELECT * FROM response";
//echo $q1;
$r3= mysqli_query($dbc,$q3);
if(mysqli_num_rows($r3)>0)
{
$_SESSION['export1']='';
while($row1=mysqli_fetch_assoc($r3))
{
if(isset($_POST[$row1['id']])=='$row1[id]')
{
if(!empty($row1['id']))
{
$_SESSION['export1']=$_SESSION['export1'].$row1['id'].',';
}
}
}
$_SESSION['export1']=rtrim($_SESSION['export1'],',');
//echo $_SESSION['export'];
}
//$contents = "Username \t Campaign \t Name \t Email \t Contact \t Gender \t Address \t Date \t Status\n";
$contents = "Name \t Email \t Contact \t Gender \t Address \t Query \t Date \t Status\n";
$export_id = explode(',',$_SESSION['export1']);
for($i=0;$i<count($export_id);$i++)
{
//echo $export_id[$i];
$q4 = "SELECT * FROM response where id = $export_id[$i]";
//echo $q1;
$r4= mysqli_query($dbc,$q4);
if(mysqli_num_rows($r4)>0)
{
while($row1=mysqli_fetch_assoc($r4))
{
}
}
else
echo '';
}
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
header("Pragma: no-cache");
header("Expires: 0");
echo $contents;
exit();
}