File manager - Edit - /home/autoph/public_html/tasks/xlsFiles.tar
Back
csvSubGroup_list.php 0000644 00000001376 15025030247 0010577 0 ustar 00 <?php include_once("../../../cfg/conn.php"); $sql ="SELECT * FROM pms_sub_group WHERE deleted=0 ORDER BY sub_group_name ASC"; header("Content-Type: application/xls"); header("Content-Disposition: attachment; filename=rptAreaList.csv"); header("Pragma: no-cache"); header("Expires: 0"); //make the column headers what you want in whatever order you want echo 'ID, CODE,NAME,DESCRIPTION'."\n"; //loop the query data to the table in same order as the headers $getArea = mysqli_query($conn,$sql); $statRow = mysqli_num_rows($getArea); if($statRow > 0){ while($row = mysqli_fetch_array($getArea)){ echo $row['id'].",".$row['sub_group_code'].",".$row['sub_group_name'].",".$row['sub_group_desc']."\n"; } } ?>