I'm beginning in PHP and I've been tasked to create a form with which the user can select a category (a row from a table in the MySQL Database) and update the content of a specific column in that row.
Here is what it looks like. Here is what the table in MySQL looks like (tva is the column in which I want to update the content)
Here is what the code looks like :
<tr>
<td>Modify the TVA of : </td>
<td>
<select name="tva_modif">
<?
$sql_tva_modif = "SELECT id_type, nom_fr,tva
FROM type
ORDER BY nom_fr
;";
$sql_tva_modif_result = mysql_query($sql_tva_modif);
while($val_tva_modif = mysql_fetch_array($sql_tva_modif_result))
{
echo "<option value='" . $val_tva_modif["id_type"] . "'>" . $val_tva_modif["nom_fr"] . "</option>";
}
?>
</select>
<input name="tva_val" id="tva_val" type="text" value=""></div>
</td>
</tr>
If possible, can someone explain me how to make sure that the input type text field display the TVA value of the selected option and how to make that field update the content of that column in my database ?
</div>