title: HTML/PHP Rendering data from DB to HTML form
body: <p>Need help in handling data and populating:</p>
  
  <p>I am creating Employee database, there are two pages:
  1. Add Employee
  2. Modify Employee</p>
  
  <p>Add Employee, takes inputs like EMP Name, EMP ID, Manager name (drop downlist), Location (radio option of them is selected)
  All these inputs are written in to the database.</p>
  
  
                
                  Employee ID
                
              
  
  <pre><code>        &lt;div class="fb-input-number"&gt;
            &lt;input id="item12_number_1" name="emp_number" min="0" max="999999999" autocomplete="off" data-hint="" required="" step="1" type="number"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
         &lt;select id="item13_select_1" name="Manager" data-hint=""&gt;
              &lt;option id="item13_0_option" value="Tom" &gt;
                TOM
              &lt;/option&gt;
              &lt;option id="item13_1_option" value="Harry" selected="selected"&gt;
                HARRY
              &lt;/option&gt;
        &lt;/select&gt;
         &lt;label id="item16_0_label"&gt;
              &lt;input id="item16_0_radio" checked="checked" name="radio_location" data-hint="" value="IND" type="radio"&gt;
              &lt;span id="item16_0_span" class="fb-fieldlabel"&gt;
                INDIA
              &lt;/span&gt;
          &lt;/label&gt;
          &lt;label id="item16_1_label"&gt;
              &lt;input id="item16_1_radio" name="radio_location" value="EMEA" type="radio"&gt;
              &lt;span id="item16_1_span" class="fb-fieldlabel"&gt;
                EMEA
              &lt;/span&gt;
          &lt;/label&gt;
  </code></pre>
  
  <p>In Modify Employee page, based on the emplyee ID, I want to render the page with values from db to the html page.
  I am using the similar page to modify the entries. I am able to display text field by value=$EMPID. How do I do the same for dropdown list and checkbox?</p>
  
  
                
                  Employee ID
                
              
  
  <pre><code>        &lt;div class="fb-input-number"&gt;
            &lt;input id="item12_number_1" name="emp_number" min="0" max="999999999" autocomplete="off" data-hint="" required="" step="1" type="number" value="11222"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
         &lt;select id="item13_select_1" name="Manager" data-hint=""&gt;
              &lt;option id="item13_0_option" value="Tom" &gt;
                TOM
              &lt;/option&gt;
              &lt;option id="item13_1_option" value="Harry" selected="selected"&gt;
                HARRY
              &lt;/option&gt;
        &lt;/select&gt;
         &lt;label id="item16_0_label"&gt;
              &lt;input id="item16_0_radio"  name="radio_location" data-hint="" value="IND" type="radio"&gt;
              &lt;span id="item16_0_span" class="fb-fieldlabel"&gt;
                INDIA
              &lt;/span&gt;
          &lt;/label&gt;
          &lt;label id="item16_1_label"&gt;
              &lt;input id="item16_1_radio" name="radio_location" value="EMEA" type="radio" checked="checked"&gt;
              &lt;span id="item16_1_span" class="fb-fieldlabel"&gt;
                EMEA
              &lt;/span&gt;
          &lt;/label&gt;
  </code></pre>
  
  <p>Can you please help me.</p>
  
  <hr>
  
  <p>Basically I am coming up with Modify Page, which would retrieve data from db and display in the HTML form.Below code did not help to display the selected value:  </p>
  
  <pre><code>&lt;?php
  mysql_connect($SERVER_IP, $USERNAME, $PWD) or die(mysql_error());
  mysql_select_db($DBNAME) or die(mysql_error());
  
  $result=mysql_query("SELECT * from `Data` where Emp_ID = $MyEmpID ");
  $info = mysql_fetch_array( $result );
  $Location=$info['Location'];
  ?&gt;
  
  &lt;html&gt;
  &lt;body&gt;
          &lt;div class="fb-dropdown"&gt;
                &lt;select id="item13_select_1" name="location" data-hint=""&gt;
                  &lt;option id="item13_0_option" value="BLR" &lt;? if ($Location=="BLR") echo "selected"; ?&gt; &gt;
                    Bangalore
                  &lt;/option&gt;
                  &lt;option id="item13_1_option" value="EMEA" &lt;? if ($Location=="EMEA") echo "selected"; ?&gt; &gt;
                    EMEA
                  &lt;/option&gt;
                &lt;/select&gt;
              &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How do I resolve it?</p>