I am working on export excel data to using php
but it has problem on downloaded as csv with comma separated values
but i need XLS file with table field values
I using the below code
$values = mysql_query("SELECT * FROM $table");
while ($rowr = mysql_fetch_row($values)) {
for ($j=0;$j<$i-1;$j++) {
$csv_output .= $rowr[$j]."; ";
}
$csv_output .= "
";
}
$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;