How to output MySQL query results in CSV format?