Monday, 15 September 2014

php - MySql error using OPTIONALLY ENCLOSED BY -



php - MySql error using OPTIONALLY ENCLOSED BY -

i uploading huge csv file in mysql database using load info local infile command.

the table has got single field(hids) integer,primary , autoincrement.the query

$insert_query = "load info local infile '".$target_path."' table master_huts(hids) optionally enclosed '\"' ignore 1 lines ";

the csv file contains,

id "343" "454" "777"

if remove double quotes csv file works fine. how can tell mysql ignore double quotes csv file.

try this:

$insert_query = "load info local infile '".$target_path."' table master_huts(hids) fields enclosed '”' lines terminated '\n' ignore 1 lines;

php mysql csv load-data-infile

No comments:

Post a Comment