0
Good afternoon, Folks
I’m new to the subject, and I’m having trouble capturing the field selected by the user in a combobox to make a change to the database from the selection.
The code of the page.php.
$dbconn = mysqli_connect('localhost','local','x','dblocal');
$query = "SELECT AcoesReinc from DescAcoes";
while ($registro = mysqli_fetch_assoc($consultaslot))
{
echo "<tr>";
echo "<td>".$registro['TQA_DATA_CRIACAO']."</td>";
echo "<td>".$registro['TQA_CODIGO']."</td>";
echo "<td>".$registro['TQA_RAIZ']."</td>";
echo "<td>".$registro['TAB_FABRICANTE']."</td>";
echo "<td>".$registro['TAB_HOSTNAME']."</td>";
echo "<td>".$registro['TAB_SLOT']."</td>";
echo "<td>".$registro['TAB_PORTA']."</td>";
echo "<td>".$registro['TAX_BAIXA_CAUSA_NOME']."</td>";
echo "<td>".$registro['VERIFICADO']."</td>"; ------> //aqui eu termino de montar o td do primeiro select e inicio o combobox para seleção do campo a partir de um segundo select
echo "<td><select name='combo' form name ='combo' form action='consultareincidenteteste5.php' method='post'>";
foreach ($dbconn->query($query) as $prod) {
echo '<option value="'.$prod['AcoesReinc'].'">'.$prod['AcoesReinc'].'</option>';
}
'</select>';
echo "<input type='submit' name='enviar' value='enviar'>";'</form>';
"<td>";
}}
I’m trying to send what was selected for the relapse consult5.php
var_dump($_POST);
$valor = $_POST['combo'];
echo $valor;
But she returns to me:
array(0) { }
I wonder how I can store the field that was selected in the combobox by the user.
Thank you very much for your attention!
Are you putting the form inside the select? Create a form outside the select
– adventistaam
You want to send only combo box data?
– adventistaam
The form was really wrong!! Thank you very much!
– D Pedroso