title: Column names from MySQL to CSV file
body: <p>i've a table in a database i would like to use as a contacts table to import into outlook.</p>
  
  <p>what i would like the import to do is this:</p>
  
  name | email 
  
  <p>andy | ds@ds.com &lt;--name and email entered</p>
  
  <p>at the moment i have this code:</p>
  
  <pre><code>(SELECT 'Name', 'Email') 
  union all
  (select E_Name, Email
  INTO OUTFILE '/xampp/tmp/Sample.csv'
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  ESCAPED BY '\\'
  LINES TERMINATED BY '\n'
  FROM email WHERE 1)
  </code></pre>
  
  <p>this creates an excel file like this:</p>
  
  <p>A   |   B   &lt;-- excel column names</p>
  
  <p>Name  |  Email</p>
  
  <p>andy  |  ds@ds.com</p>
  
  <p>i know if i pull the information using odbc connection it pulls the information the way i require, however i want it so the csv file is created with this information already in it, thus removing the need to do the odbc method.</p>