ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/excel/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/excel/pin-code-export.php |
<?php ini_set('memory_limit', '333000MB'); include("../inc/config.php"); include("../db.php"); $report_name="Pincode Report "; header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename='.$report_name.'-'.date("Y-m-d").'.csv'); $output = fopen("php://output", "w"); $statement="SELECT * FROM `pincode`"; $result=mysqli_query($conn,$statement); $datas=array(); fputcsv($output, array('S.No','Pincode','City','State','Service','Air','Road','Tat','Area Code')); $i=1; foreach($result as $row) { fputcsv($output, array($i,$row['pin_code'],$row['city'],$row['state'],$row['service'],$row['air'],$row['road'],$row['tat'],$row['area_code'])); $i++; } fclose($output); ?>