I have a csv file saved from Excel that I am trying to import into a mysql table. The problem is that only the first line gets inserted, the rest of the file is not inserted into table1.
This is the mysql command that is processing the file:
$result = mysql_db_query($sql_db,"LOAD DATA LOCAL INFILE './db_upload/import.txt' INTO TABLE table1 FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\r\n'" or die (mysql_error());
How can I format the 'LINES TERMINTED BY' statement to get mysql to process all the lines (or until end of file)?
I have tried inserting extra character at the end of each line (eg: '|) and LINE TERMINATED BY '"\|\"' but it is not working.
The second question is when trying to use 'LOAD DATA LOCAL INFILE' with Apache2.0.43 (running a module) and MySQL 3.23.53, it return the error the command is not supported. This is because the function is disable for security issue, but when I tried to start mysql with 'c:\mysql\bin\mysqld-nt --local-infile=1' it still does not work.
Thank you.
This is the mysql command that is processing the file:
$result = mysql_db_query($sql_db,"LOAD DATA LOCAL INFILE './db_upload/import.txt' INTO TABLE table1 FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\r\n'" or die (mysql_error());
How can I format the 'LINES TERMINTED BY' statement to get mysql to process all the lines (or until end of file)?
I have tried inserting extra character at the end of each line (eg: '|) and LINE TERMINATED BY '"\|\"' but it is not working.
The second question is when trying to use 'LOAD DATA LOCAL INFILE' with Apache2.0.43 (running a module) and MySQL 3.23.53, it return the error the command is not supported. This is because the function is disable for security issue, but when I tried to start mysql with 'c:\mysql\bin\mysqld-nt --local-infile=1' it still does not work.
Thank you.