1
The function Obtem_Todas_Meta
returns to query of the bank, I associate obtain the id
that need and send by form, but the value I selected is not sent correctly, as it ends up sending the last value and the times of the first of the list option
.
<select name="opcaometa">
<?php
$dados = Obtem_Todas_Meta();
while ($resultado = mysqli_fetch_array($dados)){ ?>
<option value="3"><?php echo $resultado['id_met']."-".$resultado['titulo_met']; ?>
</option>
<?php }?>
</select>
the field is
id_met
?– novic
that the field I want to send is id_met to register in the bank
– Hamilton Ventura
i still thought about sending through a session //$_SESSION['id_da_meta'] = $result['id_met']; but still sends the wrong value
– Hamilton Ventura
<select name='opcaometa'> <option value='Advanced PHP Course' name='Advanced PHP Course>Advanced PHP Course</option> </select>, if your select is being generated dynamically in this way, no Hamilton blems will occur. If it still doesn’t work there is problem elsewhere in the code.
– Bsalvo
@Hamiltonventura edited the question making the code easier to read and realized that in PHP within the
option
there are an quotes missing in."-.
. Please check your original code to see if it exists.– Woss
yes there is, it was probably time for me to edit the code to send it got like this
– Hamilton Ventura
give a look updated with a database image , I selected the number 15 as ID in the option and it sent 14 -
– Hamilton Ventura
<option value=""
here is a problem?– novic
I am testing here I have already updated put a value 3. The value that the option sends is always the one of the first item in the list.
– Hamilton Ventura