title: SQL LOAD DATA local file
body: <p>My data look like this.</p>
  
  <pre><code>company_name,brand_name,product_name,usage_annotation,organic_standard
  ASB Greenworld Ltd.,ASB Greenworld Ltd.,Organic Garden Manure,,"COS,NOP"
  ASB Greenworld Ltd.,ASB Greenworld Ltd.,Organic Seed &amp; Herb Soil,,"COS,NOP"
  ASB Greenworld Ltd.,ASB Greenworld Ltd.,Organic Moisture Soil,,"COS,NOP"
  </code></pre>
  
  <p>My query look like this in php</p>
  
  <pre><code>$sql = "LOAD DATA LOCAL INFILE '".$file_url_with_name."' INTO TABLE ".$table_name." FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '\\'";
  $sql .= " LINES TERMINATED BY '\n' IGNORE 1 LINES (company_name,brand_name,product_name,usage_annotation,organic_standard);";
  </code></pre>
  
  <p>where $file_url_with_name is my file path with actual filename with extension
  $table_name is table im trying to load data to.</p>
  
  <p>It gives me this error:</p>
  
  <pre><code>WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' IGNORE 1 LINES (company_name,brand_name,product_name,usage_annotation,organic_' at line 2]
  LOAD DATA LOCAL INFILE '/home/data/test-data.csv' INTO TABLE wpiy_test_data FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\' LINES TERMINATED BY ' ' IGNORE 1 LINES (company_name,brand_name,product_name,usage_annotation,organic_standard);
  </code></pre>
  
  <p>IF anyone can help that be great</p>