Jump to content

[SOLVED] csv to mysql.....


popmotsy

Recommended Posts

To save into a CSV:

SELECT * INTO OUTFILE 'filename.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM ? 

 

To load from:

LOAD DATA INFILE 'filename.csv' REPLACE INTO TABLE ? FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' 

 

The replace is optional, just depends if you want it to change existing rows.

Link to comment
https://forums.phpfreaks.com/topic/150120-solved-csv-to-mysql/#findComment-788547
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.