Solved

PHP spreadsheet data source

Posted on 2011-03-06
4
375 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

713 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