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
精彩评论