-2
a forum recommended using this schema to take the data from an SQL column and bring it to select. However, when I submit the form, what is being sent is the id_project and not the project name_name. I am using the $_POST method. How to resolve? (I put the related parties only)
$nomeproj = $_POST['tipoProjeto'];
$insert="INSERT INTO despesas(
nomeProjeto)
VALUES(
'$nomeproj')";
<p> <select name="tipoProjeto" id="projeto" required>
<option value="" disabled selected>Projeto</option>
<?php while($prod = mysqli_fetch_array($query)) { ?>
<option value="<?php echo $prod['id_projeto'] ?>"><?php echo $prod['nome_projeto'] ?></option>
<?php } ?>
</select></p>
This is because it will be something shown on the screen on another page for an Adm. It’s already created, but what appears there is the project id and not the name.
– Gustavo S. Rocha
I get it. Making this switch, the name will appear there.
– Leandro Luque