i want to print first value of id 219 is mentioned in the screenshot for case:downloadl then i need to print 2nd value id=219 for case :downloadp.but,the array $value['printp'] getting both the values into the table(ex:Select usera Select userb). but i need to print only one and first value for this $value['printp'].
case 'downloadl':
$sql = "SELECT post_id,printprocess,printsupply,printesb,printwork,printpri,printmate FROM printtable WHERE post_id=" .$post_id;
$query = $db->sql_query($sql);
$print_data = array();
while($roww = mysqli_fetch_array($query)){
$print_data[] = array(
'printp' => $roww['printprocess'],
'prints' => $roww['printsupply'],
'printsb' => $roww['printesb'],
'printwrk' => $roww['printwork'],
'printpr' => $roww['printpri'],
'printmat' => $roww['printmate'],
);
}
foreach($print_data as $value) {
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, '');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, '');
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printing Process');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printp']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Supplier');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['prints']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Espon Sub');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printsb']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'WorkFlow ID');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printpr']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printer');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printwrk']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printing Material');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printmat']);
$i++;
$j++;
}
break;
case:downloadp:
foreach($print_data as $value) {
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, '');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, '');
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printing Process');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printp']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Supplier');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['prints']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Espon Sub');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printsb']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'WorkFlow ID');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printpr']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printer');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printwrk']);
$j++;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$j, 'Printing Material');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$j, $value['printmat']);
$i++;
$j++;
}
break;