I would like to waste everyone's time and note that when exporting a csv from a mysqli select it is necessary to use double quotes for \n (."\n". works and .'"\n"'. does not) instead of single quotes. I get this from one (my own) source while modifying mml21's code @ http://stackoverflow.com/questions/16391528/query-mysql-and-export-data-as-csv-in-php
I'm a total noob and only pray that I can help. This has only been tested with OpenOffice.
