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

Edited by jalmz
Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.