0
I have this code that would have to load a select and just below one would have a textarea, however, after I put the php code to fill the select, my textarea is gone and I can’t identify the reason.
<?php $query = mysql_query("SELECT id, descricao FROM produto"); ?>
<div class="form-group">
<label for="produto" class="col-sm-2 control-label">Produto</label>
<div class="col-sm-10">
<select class="form-control" name="produto" id="produto">
<option>Selecione...</option>
<?php while($prod = mysql_fetch_array($query)) { ?>
<option value="<?php echo $prod['id'] ?>"><?php echo $prod['descricao'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label for="pessoaObservacoes" class="col-sm-2 control-label">Observações</label>
<div class="col-sm-10">
<textarea class="form-control" name="pessoaObservacoes" id="pessoaObservacoes" placeholder="Observações" rows="3"></textarea>
</div>
</div>
ó the textarea there?!
– Sam
Isn’t the point and comma you forgot here? Note: I added <option value="<? php echo $Prod['id']; ? >"><? php echo $Prod['Description']; ? ></option>
– Anderson Henrique
No, I already put those stitches and comma, but continued with the same problem.
– w.rock
At what point does the code no longer load? Are all options filled with the correct values? Which version of PHP do you use?
– Darlei Fernando Zillmer
Your textarea is gone because there is some error in your code, using the
echo
on each line to know where the problem might be.– Fábio Alves
The version of my PHP is 7.0.13. The option does not load the database information. The application loads only the option without the database information. The problem is that no error code appears.
– w.rock