export data from csv or excel file to Mysql in PHP

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
deeppak
Forum Commoner
Posts: 27
Joined: Thu Apr 06, 2006 6:31 am

export data from csv or excel file to Mysql in PHP

Post by deeppak »

i want to export the data from a csv or exel file to mysql data base in php plz provide me the solution or code for this

three approaches can be there

a.) first upload a file through php code and then tranferring the data to mysql database.
b.)second the file is still on the client and i dont want the file on the server i just wants its data to be imported to mysql database.
c.)I upload the file through some ftp tool to the server and from there i am entering the data to mysql database.

speedy assistance is soliciated

Thanx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

fgetcsv(), and pear has a proposed package to read Excel files.

As for providing you with a solution: no, this is a learning place not a code repository or place to request all the work be done for you.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Take a look at phpclasses.org. They have quite a few classes there.
wyred
Forum Commoner
Posts: 86
Joined: Mon Dec 20, 2004 1:59 am
Location: Singapore

Post by wyred »

You can upload the data in a .csv into a table using phpMyAdmin.
Post Reply