Hi,
I uploaded the excel and the data is successfully inserted to the database, by submitting the "submit button" using php script. There is an final stage for me to do is the validation of the excel before inserting the data to the database. I don't get any idea on validation. In my excel, i should validate that the first row should contain "the following heading"(ie numbers,marks,grade,attention etc) and then from the second row the values should be checked(validate) by the PHP script(number should be only 8digits,marks should be <=3digits,grade should be 1digit,attention should be <=2digits and finally empty row) and finally should gets inserted to the database by successfully. How can i validate the excel rows and columns using PHP script? Thanks in advance

Recommended Answers

All 2 Replies

hi

i you're using the xml-version of an excel file it should be at least reasonably simple. If not, I actually think that you're getting into deep trouble.

There are basically three ways.
1) Take some money and buy a professional solution.
2) Google very long in the net and try to get enough code snippets.
3) have a look at http://www.wotsit.org/ and try to understand xls on your own. The good thing is, if you really get your script to work, you can easily sell it yourself.

PS Is it neccessary to use excel?

I have done quite a bit of work with uploading and reading data from Excel and the tool that I have used is the php-excel-reader. This lets you access the rows and columns in the spreadsheet (after you upload it). It should work just fine for what you need to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.