开发者

Using MYSQL Load Data with TXT file, need to ignore first line

I have a PHP script setup to receive a CSV file.

I'm using the 'LOAD DATA INFI开发者_如何学JAVALE.. REPLACE' function to read it into a table.

But I need to ignore the first line of the file, whats the most efficient way to do that?

The csv is < 100kb, around 350-400 lines


The most efficient way for 'LOAD DATA INFILE' is to use 'IGNORE number LINES' clause.

LOAD DATA INFILE Syntax

e.g. LOAD DATA INFILE 'data.csv' INTO TABLE table1 IGNORE 1 LINES;


You can use the fgetcsv function?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜