Converting an Excel spreadsheet to MySQL

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
smoky989
Forum Commoner
Posts: 41
Joined: Mon Sep 02, 2002 1:14 pm

Converting an Excel spreadsheet to MySQL

Post by smoky989 »

Can it be done and if yes some tips or a link to a tutorial would be nice. Thanks in advance.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

can be done

Post by lostboy »

does you mysql exist on windows server? then just use COM to open the sheet and loop through the cells to take the values and place them in the db...

http://www.php.net/manual/en/ref.com.php
Rob the R
Forum Contributor
Posts: 128
Joined: Wed Nov 06, 2002 2:25 pm
Location: Houston

Post by Rob the R »

I found a pretty clear tutorial using phpMyAdmin:
http://zarook.com/dbs/rose/index.php?category=4

If you don't have phpMyAdmin, this discussion:
http://www.webmasterworld.com/forum13/1647.htm
describes how to use the MySQL command LOAD DATA INFILE to do it.

I found these sites with Google, so I have not personally tried the processes they describe. Good luck!
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Post by superwormy »

done it far to many times...

export to comma delimeted text file

write script ( see http://www.php.net/fopen, http://www.php.net/file ) to extract and insert
sunkara
Forum Newbie
Posts: 3
Joined: Thu Jan 09, 2003 1:10 pm

Post by sunkara »

Hi smoky...there is a statement in mysql kalled LOAD DATA INFILE..., u kan use this to get data from excel spreadsheet to mysql. But before using that u save ur excel spreadsheet as text(with tab delimited). Then u kan use the mysql statement for a tab delimiter.
http://www.mysql.com/doc/en/LOAD_DATA.html

This would be helpful to u
Post Reply