can phpmyadmin import excel files

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
rami
Forum Contributor
Posts: 217
Joined: Thu Sep 15, 2005 8:55 am

can phpmyadmin import excel files

Post by rami »

i have some data in tabular form in excel.
I have designed equal number of columns ,design table in mysql database...
but it has been difficult to insert data one by one

can that excel data directly inserted as data in table
in excel
A B.............
name Age
Harry 12

in mysql table i have
name varchar(25),
age int,.....

can that excel file impoted as data to mysql table
thanks...

and whats about vice versa ...
from mysql table to excel for print...
i am using phpmyadmin....but can use other soft was well if there are any
thanks
if not from any plian text document to mysql table but not giving commands...(insert into ....
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

export from Excel into csv-format (comma separated values) and import it with phpMyAdmin
rami
Forum Contributor
Posts: 217
Joined: Thu Sep 15, 2005 8:55 am

Post by rami »

patrikG wrote:export from Excel into csv-format (comma separated values) and import it with phpMyAdmin
really thanks i will try
this will solve lot of dataentry problem...

then may be excel can also open that csv file.
thanks
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Just wondering how to read the values from the Excel file to put it as a csv file?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

use Excel...
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Is it any way possible to automate the generation of csv files...
I once had a requirement where I have to read quotes for different products from different suppliers and load them onto Mysql for further processing...this should all happen with the click of a mouse...how do you think this can be done?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

CSV is sometimes not the best way to import files. I have tried this before (Excel to MySQL to Excel) and have noticed that sometimes both Apps separate on non-separating commas. For example, if a money field is entered as 12,345 instead of 12345 that field is split into two fields.

I like to lean toward tab separated text fiels for entry into the MySQL tables. phpMyAdmin has a wonderful import tool that will let you choose just about all the parameters available for importing. It is usually located on the import tab when viewing a table.

To automate the process have a look at the phpMyAdmin import code and see if you can't develop something along those lines.
Post Reply