I'm trying to put proper values into appropriate cells but cannot figure it out
Let me show you what I'm trying to accomplish
Correct Output
but instead it shows me that
Incorrect Output
So, I've began with a simple while loop to loop for records from a database for a selected date
$query = "SELECT DISTINCT dates FROM sample_table";
...
$datesLetter = 'D';
$valueIncrementId = 2;
while($dates = $db->fetch_array($query))
{
...
$nextQuery = "SELECT c1.id, c1.value FROM values AS c1
LEFT JOIN sample_table AS c2
ON c1.id = c2.val_id WHERE c2.date = $date";
$valueIncrementId = 2;
while($v = $db->fetch_array($nextQuery))
{
$objPHPExcel->setActiveSheetIndex()->setCellValue($datesLetter.$valueIncrementId, $v['value']);
$valueIncrementId++;
}
$datesLetter++;
}
Thanks in advance
Regards, Bes