Solved

PHP spreadsheet data source

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

808 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