Solved

Reading from an Excel file

Posted on 2002-06-19
5
204 Views
Last Modified: 2011-09-20
hi folks
I have aproblem in reading and updating the  cell contents of an excel file through PHP.
Can you please help me ASAP.
Thanks in advance.
0
Comment
Question by:empriya
  • 2
5 Comments
 
LVL 40

Expert Comment

by:RQuadling
ID: 7092235
What method are you using? ODBC or COM?
0
 
LVL 40

Accepted Solution

by:
RQuadling earned 70 total points
ID: 7092252
If you are using ODBC, then make sure you add a $ to the end of the sheet name.

So,

"SELECT * from [Sheet1$]"

would be a valid query string.

A few things to be aware of :

1 - Column headings are required otherwise you will get your first row of data as column names.
2 - Column headings cannot be blank!

You can also set a name to some cells that you want to access via ODBC.

Select the required cells.

Choose Insert->Name->Define and give it a name, say "Testing"

You can then you ...

"SELCT * FROM Testing".

Regards,

Richard Quadling.
0
 
LVL 11

Expert Comment

by:shmert
ID: 9643489
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept: rquadling
Please leave any comments here within the next seven days.
               
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
               
Sam Barnum
EE Cleanup Volunteer              
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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.

939 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

10 Experts available now in Live!

Get 1:1 Help Now