473,574 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting Excel to MySQL using PHP

2 New Member
How we wil convert from ms-Excel sheet to MySQL database using PHP
Jan 5 '07 #1
3 13532
ronverdonk
4,258 Recognized Expert Specialist
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
limweizhong
62 New Member
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 Recognized Expert Specialist
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
2873
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 knew db's and gave me long list of things to do with that particular database, first thing being that particular conversion. Truth is that I don't know...
3
2003
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 intention that the user opens the excel-file trough the browser, so I hope there does not have to be installed anything on the clients machine... (I looked...
2
1884
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 user must open seven Excel workbooks so that each can lookup values in the other to rollover into a separate "summary" workbook. Obvious problems...
1
2630
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 I entered text values and for numeric columns I entered numeric values. It works fine and pass through all the validation checks and gets inserted...
6
3970
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 example In excel in mySQL 45,45 -> 45 2005-01-01 -> 0000-00-00
1
6486
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 function but don't know how to pass an array of the recordset they made into that function. This uses GetRows that nicely creates an array that can...
8
2225
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 lossless fashion to a more modern format. The database has more than 65K rows, so converting it to be an Excel spreadsheet, would, AFAIK, not be an...
5
5077
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, we should put the script in cgi-bin directory, use of ASCII transfer mode, chmod 755 scriptname.cgi, and then login to unix and type ./scriptname.cgi....
1
1884
by: dsudhakara | last post by:
please help me immediatly How we wil convert from ms-Excel sheet to MySQL database using PHP
0
7719
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8044
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5299
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3749
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1055
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.