Hi all,

Can anyone help me or give me an idea on how export data from mysql into multiple excel sheet using php? Below is the code I used to export data from mysql in a single excel sheet. thanks in advance

	$filename = 'filename.csv';

	include 'connection.php';
	$date = date("m/d/Y");

	header("Content-type: appilication/x-msexcel");
	header("Content-disposition: attachment; filename=".$filename);
	header("Pragma: no-cache");
	header("Expires: 2");

	$csv_output1.='EMPLOYEE ID'.",";

	echo $csv_output1;
	$view=mysql_query("SELECT * FROM tbl_name where Date='$date'");
			$a = $result['Line'];
			$b = $result['Shift'];
			$c = $result['Function'];
			$d = $result['EmpNo'];
			$e = $result['EmpName'];

			echo $csv_output;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.