title: Nested while for table select only giving one result
body: <p>I'm trying to get a list of items from a MySQL query for a drop down list and display the information in another while which delays each row in a table. </p>
  
  <p>it works when i don't use the second while but once added the first select has the results i'm expecting but the following rows are blank.</p>
  
  <pre><code>&lt;table style="width:100%"&gt;
      &lt;tr&gt;
          &lt;td&gt;Type&lt;/td&gt;
          &lt;td&gt;Qty&lt;/td&gt; 
          &lt;td&gt;Temp(°C)&lt;/td&gt;
          &lt;td&gt;From&lt;/td&gt; 
          &lt;td&gt;To&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;?php 
          if ($order_search-&gt;num_rows &gt; 0) {
              // output data of each row
              while ($detail = mysqli_fetch_array($order_search)) {
                  echo "&lt;td&gt;";
                  echo "&lt;select name='type'&gt;";
                  while ($row = mysqli_fetch_row($item_search)) {
                      echo "&lt;option&gt;";
                      echo $row[0];
                      echo "&lt;/option&gt;";
                  }                       
                  echo "&lt;/select&gt;";
                  echo "&lt;/td&gt;";                       
                  echo "&lt;td&gt;$detail[1]&lt;/td&gt;";
                  if ($detail[2] &gt; 0) {
                      echo "&lt;td&gt;$detail[2]&amp;deg;C&lt;/td&gt;";
                  } else {
                      echo "&lt;td&gt;$detail[2]N/A&lt;/td&gt;";
                  }
                  echo "&lt;td&gt;$detail[3]&lt;/td&gt;";
                  echo "&lt;td&gt;$detail[4]&lt;/td&gt;";
                  echo "&lt;/tr&gt;";
              }
          }
      ?&gt;
      &lt;tr&gt;
          &lt;td&gt;        
              &lt;form method="post"&gt;
                  &lt;input type="hidden" name="entry_id" value="&lt;?php echo $entry_id; ?&gt;"&gt;
                  &lt;input type='hidden' name='order_id' value="&lt;?php echo $order_id;?&gt;"&gt;
                  &lt;input type="submit" name="add_equipment" value="Add Equipment"&gt;
              &lt;/form&gt;     
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Code with the added solution which now works:</p>
  
  <pre><code>&lt;table style="width:100%"&gt;
      &lt;tr&gt;
          &lt;td&gt;Type&lt;/td&gt;
          &lt;td&gt;Qty&lt;/td&gt; 
          &lt;td&gt;Temp(°C)&lt;/td&gt;
          &lt;td&gt;From&lt;/td&gt; 
          &lt;td&gt;To&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;?php 
          if ($order_search-&gt;num_rows &gt; 0) {
              // output data of each row
              while ($detail = mysqli_fetch_array($order_search)) {
                  echo "&lt;td&gt;";
                  echo "&lt;select name='type'&gt;";
                  while ($row = mysqli_fetch_row($item_search)) {
                      echo "&lt;option&gt;";
                      echo $row[0];
                      echo "&lt;/option&gt;";
                  }
                  mysqli_data_seek($item_search,0);                       
                  echo "&lt;/select&gt;";
                  echo "&lt;/td&gt;";                       
                  echo "&lt;td&gt;$detail[1]&lt;/td&gt;";
                  if ($detail[2] &gt; 0) {
                      echo "&lt;td&gt;$detail[2]&amp;deg;C&lt;/td&gt;";
                  } else {
                      echo "&lt;td&gt;$detail[2]N/A&lt;/td&gt;";
                  }
                  echo "&lt;td&gt;$detail[3]&lt;/td&gt;";
                  echo "&lt;td&gt;$detail[4]&lt;/td&gt;";
                  echo "&lt;/tr&gt;";
              }
          }
      ?&gt;
      &lt;tr&gt;
          &lt;td&gt;        
              &lt;form method="post"&gt;
                  &lt;input type="hidden" name="entry_id" value="&lt;?php echo $entry_id; ?&gt;"&gt;
                  &lt;input type='hidden' name='order_id' value="&lt;?php echo $order_id;?&gt;"&gt;
                  &lt;input type="submit" name="add_equipment" value="Add Equipment"&gt;
              &lt;/form&gt;     
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>