title: load data infile, dealing with fields with comma
body: <p>How do we deal with field with comma when using load data infile? i have this query:</p>
  
  <pre><code>$sql = "LOAD DATA LOCAL INFILE '{$file}' INTO TABLE sales_per_pgs 
          FIELDS TERMINATED BY ','
          LINES TERMINATED BY '\n'
          IGNORE 1 LINES
          (@user_id, @account_code, @pg_code, @sales_value)
          SET
          user_id = @user_id, 
          account_code = @account_code,
          product_group_code = @pg_code,
          sales_value = REPLACE(@sales_value, ',', ''),
          company_id = {$company_id},
          year = {$year},
          month = {$month}";
  </code></pre>
  
  <p>and a line from the csv looks like this:</p>
  
  <pre><code>139, pg89898, op89890, 1,000,000.00
  </code></pre>
  
  <p>where <code>1,000,000.00</code> is a sales value.</p>
  
  <p>Currently, what is inserted in my database is only <code>"1</code>.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The user downloads a form with columns like:</p>
  
  <p><code>user id</code>, <code>account id</code>, <code>pg id</code>, <code>sales value</code></p>
  
  <p>where the first three columns <code>user id</code>, <code>account id</code>, <code>pg id</code>, were populated and the <code>sales value</code> column is blank because the user has to fill it up manually... the user uses MS excel to do that...</p>
  
  <p>after the form is completed, he will now upload it, in which i am using the <code>load data infile</code> command...</p>