I am trying to populate a Bootstrap form with content from a database. Basically the user flow is, a user selects a record from a dropdown that has been filled with information from a database. Whenever they select an option from that dropdown it fills the form with the relevant data. Here is some sample code:
<?php
      mysql_connect('server', 'name', 'password');
      mysql_select_db('database');
      $sql = "SELECT * FROM table";
      $result = mysql_query($sql);
      echo "<select name='select' class='form-control'";
      while ($row = mysql_fetch_array($result)) {
            echo "<option value='" . $row['details_id'] . "'>" . $row['name'] . "</option>";
      }
      echo "</select>";
      ?>
      </div>
       <script>
       </script>
       </div>
            <legend>Edit details and submit request</legend>
            <!-- Text input-->
            <div class="form-group">
                 <label class="col-md-4 control-label" for="edit">Name:</label>
                 <div class="col-md-8">
                      <input id="edit" name="edit" type="text" class="form-control input-md">
                 </div>
            </div>
The dropdown is being filled properly, I just don't know how to fill the form with the data now!
 
     
    