Jump to content

How to upload .txt to Mysql Database using php


jalmz

Recommended Posts

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

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.

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.