title: Getting Syntax Error while trying LOAD DATA INFILE '...csv'
body: <p>I'm trying to import a csv file to my mysql database, but I can't get it to work. I looked up a lot of solutions on this website, but none of them seems to solve it.</p>
  
  <p>I'm getting the error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOAD DATA INFILE 'name.csv' INTO TABLE test FIELDS TERMINATED BY ',' ' at line 2.</p>
  
  <p>This is my name.csv file and my php code:</p>
  
  <pre><code>productId,ean,title
  10060,8720094110226,KATRIZ Epson 
  10059,8720082041877,Lexmark 14L0198
  
  $link = mysqli_connect("localhost", "username", "password", "");
  
  $query = &lt;&lt;&lt;eof
  USE `db_name`;
  LOAD DATA INFILE 'name.csv'
   INTO TABLE `tablename`
   FIELDS TERMINATED BY ','
   LINES TERMINATED BY '\n'
  (productId,ean,title)
  eof;
  
  if ($result = mysqli_query($link, $query)) {
    echo "successful";
  } else {
    printf("Errormessage: %s\n", mysqli_error($link));
  };
  </code></pre>
  
  <p>I expect SQL to upload the name.csv file into my table <code>tablename</code>, but it's not working. My connection to the database gives no errors.</p>