Reputation: 294
I have a form that posts to mysql like this:
The First 2 entries ( ID and User ) need to go a specific Cell once:
$objPHPExcel->getActiveSheet()->SetCellValue('A1', $row['ID']);
$objPHPExcel->getActiveSheet()->SetCellValue('C1', $row['User']);
The others ( Date, Unit and Number ) need to post to the row from left to right.
Like this:
Upvotes: 0
Views: 422
Reputation: 1200
//some code to get the data from mysql
//teller to know where to start in sql
$teller = 5;
foreach($yourarray as $row){
$objPHPExcel->getActiveSheet()->SetCellValue('A' . $teller, $row['ID']);
$objPHPExcel->getActiveSheet()->SetCellValue('B' . $teller, $row['User']);
$objPHPExcel->getActiveSheet()->SetCellValue('C' . $teller, $row['Date']);
//D - Z?
$teller++;
}
This what u want?
Upvotes: 1