title: Multiple possibilities for LINES TERMINATED BY and FIELDS TERMINATED BY - MySQL
body: <p>I'm trying to create a feature in my Content Management System in which users can upload a CSV file which is then parsed and the data is put in a MySQL database. To do this I use a file input and this SQL query.</p>
  
  <pre><code>$sql = "LOAD DATA LOCAL INFILE '".$_FILES["file"]["tmp_name"]."'
              INTO TABLE persons
              FIELDS TERMINATED BY ';'
              LINES TERMINATED BY '\r'
              (id, name, email, contacts)";
  </code></pre>
  
  <p>This works perfectly for a <code>.csv</code> file I created on my computer, but not al CSV files have fields that are terminated by a semicolon and have lines that are terminated with a <code>\r</code>. Now I want this query to work for all <code>.csv</code> files. Otherwise this feature won't work well enough to be implemented in my CMS. Is there any way I can make this work for <code>.csv</code> files which have other field and line endings? (e.g \n, \r\n, ,)</p>