popmotsy Posted March 19, 2009 Share Posted March 19, 2009 hii to all..... I wanna code to import and export csv file to mysql without using PHPMYADMIN,,,,,I wanna a code for that,,,can anyone help me out this problame.... :-[ thanks,,,,, Link to comment https://forums.phpfreaks.com/topic/150120-solved-csv-to-mysql/ Share on other sites More sharing options...
Scorpy Posted March 19, 2009 Share Posted March 19, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.