title: This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500 With Codeigniter
body: <p>I am Working on Codeigniter whenever i use nested loops the localhost cannot handle my Request. Now i Changed My Strategy of Code But having with the same issue.This time i made Functions with for loop inside. 
  I want to get Results from two different Queries to Match the columns in nested loops or by using the Function
  Code is Attached</p>
  
  <pre><code>                  &lt;table class="table table-bordered table-responsive"&gt;
                      &lt;?php if($allow_array -&gt;result()){ ?&gt;
                      &lt;thead class="thead" &gt;
                      &lt;th style="width: 10%"&gt;Employee Number&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Employee Name&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Location&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Category&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Extra Work Allowance&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Hardship Allowance&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Shift Allowance&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Relocation Allowance&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Production Allowance&lt;/th&gt;
                      &lt;th style="width: 10%"&gt;Special Allowance Zin/KUP&lt;/th&gt;
                      &lt;/thead&gt;
                      &lt;?php }?&gt;
                      &lt;tbody class="tbody"&gt;
                  &lt;?php
  
  
  
                  $cat=" ";
                  $loc=" ";
                  $ewa=0;
                  $hsa=0;
                  $sa=0;
                  $ra=0;
                  $pa=0;
                  $sazk=0;
  
  
                  function values($cat,$loc,$ewa,$hsa,$sa,$ra,$pa,$sazk,$allow_array)
              {
           foreach ($allow_array-&gt;result() as $allow) {
  
      ?&gt;
              &lt;tr&gt;
                  &lt;td style="width: 10%"&gt;&lt;?php echo $allow-&gt;emp_no; ?&gt;&lt;/td&gt;
                  &lt;td style="width: 10%"&gt;&lt;?php echo $allow-&gt;emp_name; ?&gt;&lt;/td&gt;
                  &lt;td style="width: 10%"&gt;&lt;?php echo $allow-&gt;loc_name; ?&gt;&lt;/td&gt;
                  &lt;td style="width: 10%"&gt;&lt;?php echo $allow-&gt;category; ?&gt;&lt;/td&gt;
                  &lt;td style="width: 10%"&gt;
                      &lt;?php if (($allow-&gt;category == $cat) &amp;&amp; ($allow-&gt;loc_name == $loc) &amp;&amp; ($ewa &gt; 0)) { ?&gt;
                          &lt;input size="5" type="number" min="0" max="99"
                                 value="&lt;?php echo $allow-&gt;extra_work_allowance; ?&gt;"
                                 name=""&gt;
                      &lt;?php } ?&gt;
                  &lt;/td&gt;
                  &lt;td style="width: 10%"&gt;
                      &lt;?php if (($allow-&gt;category == $cat) &amp;&amp; ($allow-&gt;loc_name == $loc) &amp;&amp; ($hsa &gt; 0)) { ?&gt;
                          &lt;input size="5" type="number" min="0" max="1"
                                 value="&lt;?php echo $allow-&gt;hardship_allowance; ?&gt;"
                                 name=""&gt;
                      &lt;?php } ?&gt;
                  &lt;/td&gt;
                  &lt;td style="width: 10%"&gt;
  
                      &lt;input size="5" type="number" min="0" max="99"
                             value="&lt;?php echo $allow-&gt;shift_allowance; ?&gt;"
                             name=""&gt;
  
                  &lt;/td&gt;
  
                  &lt;td style="width: 10%"&gt;
                      &lt;input size="5" type="number" min="0" max="1"
                             value="&lt;?php echo $allow-&gt;relocation_allowance; ?&gt;"
                             name=""&gt;
  
                  &lt;/td&gt;
  
                  &lt;td style="width: 10%"&gt;&lt;input size="5" type="number" min="0" max="99"
                                                value="&lt;?php echo $allow-&gt;production_allowance; ?&gt;"
                                                name=""&gt;&lt;/td&gt;
  
  
                  &lt;td style="width: 10%"&gt;&lt;input size="5" type="number" min="0" max="99"
                                                value="&lt;?php echo $allow-&gt;special_allowance_zin_kup; ?&gt;"
                                                name=""&gt;&lt;/td&gt;
                  &lt;input type="hidden" value="&lt;?php echo $allow-&gt;emp_no ?&gt;" name="empname"&gt;
  
              &lt;/tr&gt;
  
      &lt;?php
                }
              }
                  foreach ($allowed_allowances as $allowances) {
                      $cat = $allowances-&gt;category;
                      $loc = $allowances-&gt;loc_name;
                      $ewa = $allowances-&gt;extra_work_allowance;
                      $hsa = $allowances-&gt;hardship_allowance;
                      $sa = $allowances-&gt;shift_allowance;
                      $ra = $allowances-&gt;relocation_allowance;
                      $pa = $allowances-&gt;production_allowance;
                      $sazk = $allowances-&gt;special_allowance_zin_kup;
                      values($cat,$loc,$ewa,$hsa,$sa,$ra,$pa,$sazk,$allow_array);
                  }
                  ?&gt;
                      &lt;/tbody&gt;
  
                  &lt;/table&gt;
  </code></pre>
  
  <p>I Also Tried to Configure Xampp Server but it does not resolve the issue</p>