?
Solved

PHP spreadsheet data source

Posted on 2011-03-06
4
Medium Priority
?
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
Mark Brady earned 1000 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

770 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