By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,257 Members | 1,577 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,257 IT Pros & Developers. It's quick & easy.

convert excel file to mysql database using php

P: 1
hi i need to convert a excel sheet to mysql database format using php code.I am not getting any help on the net on this topic.I need the code not an autogeneration tool.If any of you can solve the problem please post the answer :
i have 1.>Book.xls,2.>Mysql database on a server
Thank You.
Aug 5 '07 #1
Share this Question
Share on Google+
2 Replies


100+
P: 228
jx2
the simpliest way to do it woud be saving your data as "comma" separated text file not an excell file
if you want to use excell file you need to write binary on your own(that means a lot of work!!)
i did something like that for jpeg(exif data) if you need that for excell you need to find the description of excell file format and you need to know how to handle binaries

your only hope is that there is someone who did it before and share the code
:-)

regards
jx2
Aug 5 '07 #2

pbmods
Expert 5K+
P: 5,821
Heya, vinitaJ. Welcome to TSDN!

As jx2 suggested, your best course is to save the file in CSV ('comma-separated values') format. Then, you can use MySQL's LOAD DATA INFILE command.
Aug 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.