title: Get data from two data source and run in one loop in php
body: <p>This is kind of silly question. I have a requirement to get data from two data sources (one Oracle and another SQL Server) and compare the data. If the both data same print but if one data missing print only one side leave other blank. Currently I run two while loops and put in side by side in a table. But data not identical some times. I tried one while loop inside another but results not same as expected. How can I archive this? Is there anyway I can access data inside a one loop?</p>
  
  <p>For example :<br>
  Source 1 - [2018-10-15,2018-10-16,2018-10-18,2018-10-19]<br>
  Source 2 - [2018-10-15,2018-10-18]  </p>
  
  <p>Table Expected :  </p>
  
  <h2>Source 1 | Source 2</h2>
  
  <p>2018-10-15  | 2018-10-15<br>
  2018-10-16  | No Data<br>
  2018-10-18  | 2018-10-18<br>
  2018-10-19  | No Data  </p>
  
  <pre><code>$contents .= '&lt;div class="table-responsive col-md-6"&gt;&lt;table class="table table-striped"&gt;&lt;thead&gt;&lt;tr class="table-active"&gt;&lt;th&gt;Time Detail 1&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;';   
  
  while (odbc_fetch_row($result_1)){
      $F_time = odbc_result($result_1,"Time1");
      $s_id = odbc_result($result_1,"id");
      $contents .= '&lt;tr&gt;&lt;td class="col-md-1"&gt;' . $F_time . ' &lt;sup class="badge badge-success"&gt; ' . $s_id . '&lt;/sup&gt;&lt;/td&gt;&lt;/tr&gt;';
  }
  
  $contents .= '&lt;/table&gt;&lt;/div&gt;&lt;div class="table-responsive col-md-6"&gt;&lt;table class="table table-striped"&gt;&lt;thead&gt;&lt;tr class="table-active"&gt;&lt;th&gt;Time Detail 2&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;';
  
  while (odbc_fetch_row($$result_2)){
      $F_time2 = odbc_result($$result_2,"time2");
      $contents .= '&lt;tr&gt;&lt;td class="col-md-1"&gt;' . $F_time2 . '&lt;/td&gt;&lt;/tr&gt;';
  }
  
  $contents .= '&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;';
  </code></pre>