PHP: Writing a MYSQL query to CSV
问题 I'm attempting to write a MySQLi query to a downloadable CSV. The following headers open a stream for the CSV: $fileName = ''; //empty file name, file name is cast later header("Cache=Control: must-revalidate, post-check=0, pre-check=0"); header('Content-Description: File Transfer'); header("Content-type: text/csv"); header("Content-Disposition: attachment; filename={$fileName}"); header("Expires: 0"); header("Pragma: public"); $fh = @fopen( 'php://output', 'w' ); Below this I have the