On my test server, I created a script that would use OUTFILE to create a csv in MySQL, then open that file in PHP and add column names to the beginning of it. Unfortunately, I found out that this won't work with my webhost, as the DB is based on another server.
To work around this, I'm trying to reverse the process by first creating the .csv file with PHP and adding the headings. Then, I hope to use MySQL to append the newly-created file with the records from the DB. Can this be done? If not, is there any other way to get the data directly from the database, without any PHP intervention?