this my MySQL to generate the array :
$sql_name = "SELECT * FROM ".TABLE_PREFIX."members WHERE member_id IN ($member_id) order by member_id DESC";
$result_name = mysql_query($sql_name, $db);
$name = array();
while ($row = mysql_fetch_assoc($result_name)) {
$arr1= $row['first_name'];
$arr = array_push($name ,$arr1);
}
$name1[] = $name;
$objPHPExcel->setActiveSheetIndex()->fromArray($name1, NULL, 'C20');
This is the result that i get :
Output that i want is each array will fill 2 rows means it will take next column and merge it like this below image. How can possible to use merge?.. i new to this. please help me. thanks!
SOLUTION FOR MY QUESTION FOR REFERENCE LATER :
for($row = 20; $row <= 2; $row++) {
$objPHPExcel->setActiveSheetIndex()->fromArray($name1, NULL, 'C20')->mergeCells('C' . $row . ':D' . $row);
}
and i change my sql .. by adding empty space to the array :
$arr = array_push($name ,$arr1,'');