How to read data from excel sheet

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
clarance
Forum Newbie
Posts: 14
Joined: Sun Nov 23, 2008 10:25 am

How to read data from excel sheet

Post by clarance »

Hello,

I am doing some work for a basketball agent who essentially wants to be able to just upload his excel sheet with player statistics and then my code has to take the date from that sheet and store it in his database.

I have used this tutorial:

http://www.ibm.com/developerworks/opens ... index.html

But there are some error in his/her code, specifically in the $dom = DOMDocument::load( $_FILES['file']['tmp_name'] ); function.

Does anyone have any experience with this or maybe can guide me in the right direction.

thanks B
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: How to read data from excel sheet

Post by susrisha »

There are a number of free Excel Reading Classes available over internet to read the Excel sheets and do whatever you can with the excel data. I am attaching you one of those classes which i used for one of my projects. The code contains an example also to make u understand. Also you will not require any special php inclusions. just place the folder Excel where you want the class to be included.
Attachments
excel_reader_class.zip
(16.25 KiB) Downloaded 17 times
clarance
Forum Newbie
Posts: 14
Joined: Sun Nov 23, 2008 10:25 am

Re: How to read data from excel sheet

Post by clarance »

What if I want to be able to uplaod a file seeing that there will be hundreds of different players with different statistics?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: How to read data from excel sheet

Post by Mark Baker »

clarance wrote:What if I want to be able to uplaod a file seeing that there will be hundreds of different players with different statistics?
Whatever tool or library you use to read the Excel workbooks, they need to be on the server that is running your reader script, or at least on a box that is accessible from your web server... but there's dozens of examples of how to upload files to a web server across the internet, and even in these forums.... try doing a search on uploading files
clarance
Forum Newbie
Posts: 14
Joined: Sun Nov 23, 2008 10:25 am

Re: How to read data from excel sheet

Post by clarance »

thank you.

you have been a great help.

C
Post Reply