Posts Tagged ‘import’

import csv file into mysql database with phpMyAdmin

Thursday, March 4th, 2010

When you start to design website for your client , and sometimes your client will give you a csv or txt file which include large data in it . so you should import it into database and use it. which way is the best to do this? I think phpMyAdmin is the best choice. The example is that a client provide a txt file , exported with CSV formate . and they want to these data into the database and query online store in the website.
First , see the csv or txt file , make sure all the line is the same type, like this :
"14 Carrot Whole Foods Inc.","5300 Sunset Blvd.","Lexington","SC","29072","803-359-3920"
"365 Nutrition","1205 Johnson Ferry Rd.","Marietta","GA","30068","770-509-3644"
"4 Goodness Sake","3538 Route 309","Orefield","PA","18069","610-398-2057"
"A & A Health Foods","99 Godwin Avenue","Midland Park","NJ","07432","201-447-3130"

Then analyze the file and make sure the content for field in database. see above, and you will know that the filed order is :
(more…)