Save MySQL query results into a text or CSV file