How to import csv file with two different field terminated. I use this code
Code: Select all
$connec = mysql_connect('****','****','****');
mysql_select_db('****', $connec);
$sql = "LOAD DATA LOCAL INFILE '*****.csv'
INTO TABLE myworksheet
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ';'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
";
mysql_query($sql);
This is my row from csv file.
[text]
401,1,colomn4,500053;example1;0000000585;21.07.2011,,,,"0,000","0,000","0,000","00,000,000","0,000","0,000","0,000",0,"0,000","0,000","0,000","0,908","0,000","0,000","0,000",0,"0,000","0,000","0,000",0,"0,000","0,000","0,000",0,"0,000","0,000","0,000",908,"0,000","0,000","0,000","00,000,000"
[/text]