I would have to insert values into a database from this . My problem is that the value I have to enter is not $prov, but $id.The item the user should see is $prov. How could I do?
while ($row=mysqli_fetch_assoc($result)) {
$id=$row['id_prov'];
$prov=$row['n_provi'];
echo '<option value="'.$id.'">'.$prov.'</option>';
>Solution :
Your php program reads your database and generates a SELECT field something like this:
<select name="xxx" id="xxx">
<option value="1">Prov1</option>
<option value="2">Prov2</option>
</select>
When you submit the form containing that field, the field’s value comes from the value of the option your user chose.
You can put anything you want in the values of options. I think you want this.
<select name="xxx" id="xxx">
<option value="Prov1">Prov1</option>
<option value="Prov2">Prov2</option>
</select>