jalmz Posted January 7, 2013 Share Posted January 7, 2013 Hi guys, What is the best script or code to upload .txt file in mysql database? using php.. Thanks inside the text file.. and I would like to insert it n my existing database. "0202011328","Icore 3","3092.16","1/4/2013","Japan" "0101072497","Icore 4","80.57","1/14/2013","philippines" "0101020340","Amd athlon","2246.96","1/7/2013","USA" and the txt file consist 27 + of rows. thanks Link to comment https://forums.phpfreaks.com/topic/272823-how-to-upload-txt-to-mysql-database-using-php/ Share on other sites More sharing options...
haku Posted January 8, 2013 Share Posted January 8, 2013 What does your code look like? Link to comment https://forums.phpfreaks.com/topic/272823-how-to-upload-txt-to-mysql-database-using-php/#findComment-1404089 Share on other sites More sharing options...
Christian F. Posted January 8, 2013 Share Posted January 8, 2013 This looks to be a CSV file, which MySQL can import directly. That said, it does look like there are some normalization that should be done on the data first. Which means you'll need to read the CSV file, and parse the data, before inserting it into the relevant tables. What those tables are, depends upon what the actual fields represents. In any case, my answer is really more suited for the "Application design" forum, while your questions seems to be suited for the "Freelance" section (if you want someone to write the code for you). The PHP coding help section, which we're in now, is neither; It's for helping people with code they they have written, but are having troubles with. Link to comment https://forums.phpfreaks.com/topic/272823-how-to-upload-txt-to-mysql-database-using-php/#findComment-1404160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.