Bootstrap Validator not valid select with php data

0
Well I have in my form of register a select field that is populated with data coming from the database, however with the use of Bootstrap Validator , it does not validate correctly, now if I take the code PHP it validates correctly. What can be this.

Below is my select field:

 <div class="form-group">
    <label for="AgentePG" class=" control-label">PG</label>
    <select class="form-control" id="AgentePG" name="pg" data-bv-notempty data-bv-notempty-message="The country is required">
    <option value="">Selecione...</option>
    <?php
      $sql = DB::getInstance();
      $sql = "SELECT * FROM pg";
      $stmt = DB::prepare($sql);
      $stmt->execute();
      $busca = $stmt->fetchAll();
          foreach ($busca as $linha) {
             echo '<option value=' . $linha->id . '>' . $linha->pg . </option>';
          }
      ?>
   </select>
 </div>
    
asked by anonymous 26.04.2016 / 15:01

1 answer

1

It may be syntax error in these quotes. Copy this line and replace.

echo '<option value="' . $linha->id . '">' . $linha->pg . '</option>';
    
28.04.2016 / 01:42