title: Showing select option list (Dropdown) in dynamic html+php table
body: <p><img src="https://i.stack.imgur.com/kw00p.jpg" alt="enter image description here"></p>
  
  <p>As you can see in this image, i scan barcodes of products, insert into mysql table and retrieve that mysql table into this page by refreshing automatically. Everytime i scan a different product that list add new rows accoridng to the mysql table. </p>
  
  <p>With these codes i retrieve mysql table and echo in html table:</p>
  
  <pre><code>&lt;table id="dataTable" class="table table-condensed table-bordered" style="margin-top:0px"&gt;
      &lt;tbody&gt;
      &lt;?php
      $sat_fatura_no = $_GET['sat_fatura_no'];
      $liste_cek = @mysql_query("SELECT * FROM alisfat_listesi WHERE fatura_no = '".$sat_fatura_no."'");
      while ($a= mysql_fetch_array($liste_cek)){
          $stok_kodu2 = $a['stok_kodu'];
  
          $isim_cek = mysql_query("SELECT * FROM stoklar WHERE sto_RECno = '".$stok_kodu2."'");
          while ($isim_al=mysql_fetch_array($isim_cek)){
              $urun_isim = $isim_al['sto_isim'];
          }
          $kdv    = $a['kdv'];
  
          $kdv_cek = mysql_query("SELECT * FROM kdvler WHERE kdv_id = '".$kdv."'");
          while ($kdv_al = mysql_fetch_array($kdv_cek)){
              $kdv_isim = $kdv_al['kdv_isim'];    
          }
  
          $kdv_cek1 = mysql_query("SELECT * FROM kdvler");
          while ($kdv_al1 = mysql_fetch_array($kdv_cek1)){
              $kdv_id1    = $kdv_al1['kdv_id'];
              $kdv_isim1  = $kdv_al1['kdv_isim'];
          }
  
          echo '&lt;tr&gt;
              &lt;td width="5%"&gt;&lt;a href="satir_sil.php?stok_kodu='.$stok_kodu2.'&amp;sat_fatura_no='.$sat_fatura_no.'"&gt;&lt;button class="btn btn-mini btn-danger  input1"&gt;Sil&lt;/button&gt;&lt;/a&gt;&lt;/td&gt;
  
              &lt;td width="25%"&gt;&lt;input class="input1" type="hidden" name="sth_stok_kod[]" value="'.$stok_kodu2.'" readonly&gt;'.$urun_isim.'&lt;/td&gt;
  
              &lt;td width="10%"&gt;&lt;input style="text-align:center" class="input1" type="text" name="sth_adet[]" value="" required&gt;&lt;/td&gt;
  
              &lt;td width="10%"&gt;
                  &lt;select style="margin: 0 !important; padding: 0 !important; width:100%" name="sth_birim[]" required&gt;
                      &lt;option value="" selected&gt;Seçiniz&lt;/option&gt;
                      &lt;?php $brim2_bul = mysql_query("SELECT * FROM birimler");
                      while($brim2_cek = mysql_fetch_array($brim2_bul)){
                          echo "&lt;option ";
                          echo "value="".$brim2_cek["birim_id"].""&gt;". $brim2_cek["birim_isim"]."&lt;/option&gt;";
                      } ?&gt;
                   &lt;/select&gt;
              &lt;/td&gt;
  
              &lt;td width="10%"&gt;&lt;input class="input1" type="text" id="sth_birim_fiyat" name="sth_birim_fiyat[]" required&gt;&lt;/td&gt;
  
              &lt;td width="10%"&gt;
                  &lt;select style="margin: 0 !important; padding: 0 !important; width:100%" name="sth_kdv" required&gt;
                      &lt;option value="&lt;?php echo $stok_vergisi; ?&gt;" selected&gt;&lt;?php echo $stok_vergisi; ?&gt;&lt;/option&gt;
                      &lt;?php $kdv2_bul = mysql_query("SELECT * FROM kdvler");
                      while($kdv2_cek = mysql_fetch_array($kdv2_bul)){
                          echo '&lt;option ';
                          echo 'value="'.$kdv2_cek['kdv_isim'].'"&gt;' .$kdv2_cek['kdv_isim'].'&lt;/option&gt;';
                      } ?&gt;
                   &lt;/select&gt;
              &lt;/td&gt;
  
              &lt;td width="10%"&gt;&lt;input class="input1" type="text" id="sth_iskonto1" name="sth_iskonto1[]" required&gt;&lt;/td&gt;
  
              &lt;td width="10%"&gt;&lt;input class="input1" type="text" id="sth_iskonto2" name="sth_iskonto2[]" required&gt;&lt;/td&gt;    
  
              &lt;td width="10%"&gt;&lt;input class="input1" type="text" id="sth_tutar" name="sth_tutar[]" required&gt;&lt;/td&gt;
          &lt;/tr&gt;';
      } ?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The only part that i couldn't fix is those SELECT OPTION parts. Normally i can retrieve every row of mysql table with these select option php codes BUT when i put them inside php echo, as a normal i can not retrieve any values from database.</p>
  
  <p>So anybody has any idea how i can make these select dropdown alive inside php echo?</p>