title: how to print a particular value from an array?
body: <p>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']. <a href="https://i.stack.imgur.com/2KtKk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2KtKk.png" alt="enter image description here"></a></p>
  
  <pre><code>case 'downloadl':
  
  
  $sql = "SELECT post_id,printprocess,printsupply,printesb,printwork,printpri,printmate FROM printtable WHERE post_id=" .$post_id;
  
          $query = $db-&gt;sql_query($sql);
          $print_data = array();
          while($roww = mysqli_fetch_array($query)){
  
                   $print_data[] = array(
                   'printp'   =&gt;  $roww['printprocess'],
                   'prints'   =&gt;  $roww['printsupply'],
                   'printsb'  =&gt;  $roww['printesb'],
                   'printwrk' =&gt;  $roww['printwork'],
                   'printpr'  =&gt;  $roww['printpri'],
                   'printmat' =&gt;  $roww['printmate'],
                   );
          }
  
                foreach($print_data as $value) {
  
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, '');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, '');
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'Printing Process');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printp']);
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'Supplier');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['prints']);
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'Espon Sub');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printsb']);
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'WorkFlow ID');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printpr']);
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'Printer');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printwrk']);
                      $j++;
                      $objPHPExcel-&gt;setActiveSheetIndex(0)
                          -&gt;setCellValue('A'.$j, 'Printing Material');
                      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printmat']);
                      $i++;
                      $j++;
                  }
   break;
                case:downloadp:
  
              foreach($print_data as $value) {
  
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, '');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, '');
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'Printing Process');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printp']);
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'Supplier');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['prints']);
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'Espon Sub');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printsb']);
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'WorkFlow ID');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printpr']);
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'Printer');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printwrk']);
                              $j++;
                              $objPHPExcel-&gt;setActiveSheetIndex(0)
                                  -&gt;setCellValue('A'.$j, 'Printing Material');
                              $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B'.$j, $value['printmat']);
                              $i++;
                              $j++;
                          }
         break;
  </code></pre>