Answer the question
In order to leave comments, you need to log in
How to load csv file with HTML tags in MySQL?
There is a store database.
The Description field contains html tags in the form: < >
. Also, the data in this field contains tab characters.
First, I upload this table to excel using PHPexcel, change, add, edit, then save to csv. Then I use the code to insert back into the base:
TRUNCATE TABLE oc_product_description
LOAD DATA INFILE 'Z:\\home\\localhost\\www\\\xls\\some_excel_file - UTF8.csv' INTO TABLE oc_product_description FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' IGNORE 1 LINES (product_id,name,description,meta_description)
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question