Forum Moderators: coopster
i am trying to upload a CSV file into database but most of its values contains html characters and tags due to which values are not entered properly and some fields are left blank as sometimes ',:,; etc occurs in the values of columns and disturbs the INSERT command...
as I am using LOAD DATA INFILE command to upload this 50 MB csv file and I think there is no way to escape HTML chars with LOAD DATA INFILE (if there is pls let me know) so now i am thinking to write a script that can explode the csv file and then use htmlentities or htmlspecialchars functions to convert the html characters to string form so that it doesnt disturb INSERT command while dumping..
and then automatically dump the csv into database after converting html chars to string..
can anyone help me to write the portion of the code that can search the CSV file by column and convert all html chars to string?
thanks in advance
P.S. or is there any way to convert / escape html chars with LOAD DATA INFILE command?
ESCAPED BYclause you could incorporate.