title: Fetch Two Arrays in 1 while loop (not working)
body: <p>I'm trying to fetch arrays from two queries. The result only gets the first index. </p>
  
  <pre><code>while(($row2 = mysql_fetch_array($query1)) &amp;&amp; ($index = mysql_fetch_array($query2)))
  {
     $leaveID = $row2['leaveID'];
     $personID = $index['personID'];
     $Person_Type = $index['Person_Type'];
  
     if ($Person_Type == 'Regular') 
     {
        $Sick_Remaining_Days = 10 - $Sick_Total_Days;
     }else{
        $Sick_Remaining_Days = 5 - $Sick_Total_Days;
     }    
  
     echo "&lt;tr&gt;";
     echo ($leaveID == $personID) ? "&lt;td&gt;$Sick_Remaining_Days&lt;/td&gt;" : "&lt;td&gt;--&lt;/td&gt;";
     echo "&lt;/tr&gt;"; 
  }
  </code></pre>