public function ExportCSV(){
$this->load->dbutil();
$this->load->helper('file');
$this->load->helper('download');
$delimiter = ",";
$newline = "
";
$slash = "∕";
$filename = "testnaja.csv";
$query = "select * from student where room_id = 011";
$result = $this->db->query($query);
$data = $this->dbutil->csv_from_result($result, $delimiter, $newline);
force_download($filename, $data);
}
I want to generate excel file exporting data from my table to it.
The output in .xls and .csv
In csv output is:
Please help. Thanks.