I have the input with the name collaborator within the while:
while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
$tabela1 .= '<tr>';
$tabela1 .= '<td>'.$rows_cursos['nome'].'</td>';
$tabela1 .= '<td> <input type="text" name= "Colaborador" value=""</td>';
Within value
I want to query the employee table and create a combo with the names of all employees, so they only have to select their name instead of writing.
Within value
I wanted to do type what I did in select
:
<label for=""><h5><strong>Colaborador</strong></h5></label>
<select name="Colaborador" required>
<option></option>
<?php
$servername = "xxx.xxx.x.xx";
$username = "xxxx";
$password = "xxxxxx";
$dbname = "xxxxxx";
$conn = new mysqli($servername, $username, $password, $dbname);
$conn->set_charset('utf8');
$sql = "SELECT * FROM centrodb.colaboradores WHERE descricaovalencia = 'lar' AND estado = 1 AND Funcao = 'AAD' ORDER BY nome ASC";
$qr = mysqli_query($conn, $sql);
while($ln = mysqli_fetch_assoc($qr)){
echo '<option value="'.$ln['nome'].'">'.$ln['nome'].'</option>';
}
?>
</select>
I solved the problem this way:
<td WIDTH="80" align="center"> <select name="Colaborador" id="Colaborador">
<option></option>
<option value="1">teste</option>
</select></td>';
Instead of using input
I used select
.