Solved

PHP spreadsheet data source

Posted on 2011-03-06
4
368 Views
Last Modified: 2012-05-11
HI Experts,

I am building a simple order form for a client and they are scared off by the prospect of a MySQL DB.  Not sure why but they want to store a price list in an excel spreadsheet and upload it to the site.

Uploading isn't a problem, but is it a straight forward process to parse values from an xls or csv file into an array or session varialbe?  Any pitfalls to be aware of?

Thanks,

HNM
0
Comment
Question by:HelpNearMe
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
Mark Brady earned 250 total points
ID: 35052995
I have done it before, it's not to bad. Here is a tutorial that will show you how to do it.

http://amiworks.co.in/talk/readingparsing-excel-spreadsheet-using-php/

They may not want to use mysql because they don't have a hosting account that has mysql installed or setup perhaps? I have found many such clients and have talked them into swapping hosting companies. These ays, if a hosting company does not have a simple program like MySql they should not be hosting peoples websites for money. Just my thoughts!

I would advise you to urge them to reconsider. A mysql database is so much better for storing and manipulating data than try to read and write spreadsheets. Once they have a DB setup you can create a XLS spreadsheet of any of their tables with a button click in php so they will still have their lovely spreadsheets if they want. A good website will be hard to maintain without the DB in my opinion.

Good luck with the tutorial
0
 
LVL 2

Assisted Solution

by:adeelshahid
adeelshahid earned 250 total points
ID: 35057323
You need to be aware of break points and empty or incomplete data rows to continue on that inside the loop and to detect to break the loop when the data ends.
0
 

Author Closing Comment

by:HelpNearMe
ID: 35070015
thanks
0
 
LVL 2

Expert Comment

by:adeelshahid
ID: 35070022
thanks mate
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now