appending to a worksheet

Topics: Developer Forum, User Forum
Jun 7, 2011 at 5:11 PM



I am using PHP 5.2, PHPExcel 1.7.6.  Here' the setup.  I have a webpage where people register for an event.  We ask them name, address and email and that gets pumped into a mysql 5 database.  Every night, my script runs and takes all new entries and puts them in an excel worksheet.  So far so good.  Staff then process those incoming registrations and add data in the next columns.  For example:

user enters: John Smith, 123 fake street,

The next day the worksheet has:

name address email
John Smith 123 Fake street

The secretary comes in and adds additional information to the excel worksheet like this:

name address email paid check#
John Smith 123 Fake street Yes 123456

All well and good.  I use $objPHPExcel->getActiveSheet()->SetCellValue($excelcel, $applicant[$col]); to populate the excel worksheet.  Instead what I'd like to do is something like $objPHPExcel->getActiveSheet()->AppendRow($CommaSeparateValueOfData]);.

Is that possible?  I couldn't find anything when I search for append, but maybe there's a different name I just missed.

Alternately, I would use a loop and start at cell A1, then B1, C1, etc., until I found a row with a blank first cell.  That would be the row I would start using when I used SetCellValue.  The first column is the primary key in the database, so I know there should always be a value there.

Is looping the best solution?