Page 1 of 1

Converting an Excel spreadsheet to MySQL

Posted: Thu Jan 02, 2003 3:24 pm
by smoky989
Can it be done and if yes some tips or a link to a tutorial would be nice. Thanks in advance.

can be done

Posted: Thu Jan 02, 2003 3:44 pm
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

Posted: Fri Jan 03, 2003 7:55 am
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!

Posted: Fri Jan 03, 2003 10:36 am
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

Posted: Fri Jan 10, 2003 6:23 am
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