473,412 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

converting Excel to MySQL using PHP

How we wil convert from ms-Excel sheet to MySQL database using PHP
Jan 5 '07 #1
3 13520
ronverdonk
4,258 Expert 4TB
Simplest way is to export data from excel as TXT or CSV. Than use MySQL command
Expand|Select|Wrap|Line Numbers
  1. LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; 
When the Excel file is XML, you can write a xml parser program that parses the xml and saves the results in your MySQL db. For free XML parsing classes see XML classes at phpclasses.org.

When you are looking for a conversion program, there are a lot of them around (try googling for excel to mysql), but they all charge some dollars for usage (starting at USD 25).

Ronald :cool:
Jan 5 '07 #2
Simplest way is to export data from excel as TXT or CSV. Than use MySQL command
Expand|Select|Wrap|Line Numbers
  1. LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; 
When the Excel file is XML, you can write a xml parser program that parses the xml and saves the results in your MySQL db. For free XML parsing classes see XML classes at phpclasses.org.

When you are looking for a conversion program, there are a lot of them around (try googling for excel to mysql), but they all charge some dollars for usage (starting at USD 25).

Ronald :cool:
Is there any way of converting .xls files into mysql only using PHP? (then can get users to upload their excel files and automatically converting them)
Jan 5 '07 #3
ronverdonk
4,258 Expert 4TB
Have a look at this class ADODB XML and see if it fulfills your need. See the last paragraph in the quote.
This class is meant to import and export data stored in SQL databases to XML files using the ADODB library.

It provides a function to export the data of SQL query result set to XML file.

It also provides another function that parses XML files that define the data of fields to be inserted as new rows of a table also specified in the XML files.
Ronald :cool:
Jan 5 '07 #4

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

Similar topics

17
by: chicha | last post by:
Hey people, I have to convert MS Access 2000 database into mysql database, the whole thing being part of this project I'm doing for one of my faculty classes. My professor somehow presumed I...
3
by: bawar | last post by:
Hey, I can say I belong to the newbies in this subject. I own my own website with mySQL-databases, but now I have to show one table of those mySQL-databases in an excel worksheet. It is the...
2
by: John | last post by:
I'd love to hear some expert opinion on my situation. My department relies on Excel as a database, which causes crashing due to resource depleting and basically is just too slow. For example, a...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
6
by: Piotr | last post by:
Hi, I have following problem: I use a form in excel to send data into mysql server, everything is ok unless I have to deal with decimals or data fields, this simple are not recognized. For...
1
by: Jaime Leivers | last post by:
Here's a median function in access that you can call in any query. You could change this to any excel function you wanted. Most people can find the windows help file that says how to call an excel...
8
by: Michael B. Trausch | last post by:
I was wondering if anyone has had any experience with this. Someone I know is trying to move away from Microsoft Works, and I am trying to look into a solution that would convert their data in a...
5
by: Sport Girl | last post by:
Hi again my great online assistants, just would like to say that i'm testing the script under unix , and after researches on the internet, i have realised that to resolve 500 Internal Server Error,...
1
by: dsudhakara | last post by:
please help me immediatly How we wil convert from ms-Excel sheet to MySQL database using PHP
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.