Solved

PHP spreadsheet data source

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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 look for a specific file type in a local or remote server directory using PHP.

695 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