开发者

bulk insert into mysql (CSV file-Codeigniter)

I need function or code for bulk insert categories into mysql data开发者_StackOverflow中文版base.I am using codeigniter for my project.


START TRANSACTION;

DELETE FROM `mytable`;

LOAD DATA INFILE '/var/www/something.csv'
INTO TABLE `mytable`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY ''
LINES TERMINATED BY '\r\n'
(email, login, pass)

COMMIT;

this can be run directly in mysql to import data from a CSV

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜