title: export table from mysql to csv following fields properties
body: <p>suppose I have a table in mysql with the following fields:</p>
  
  <pre><code> id int auto_increment,
   name varchar(50),
   role enum('M','I','E')
  </code></pre>
  
  <p>Is there a way where I can export these data to csv but following the field properties, meaning that I wouldn't be able to add fields or rows to the csv table unless they follow these properties (id being auto-incremented, and role being one of the three option M, I and E).</p>