2
I’m trying to get the value selected by the user in a option
for days and there is no way I’m not getting use of two tables a call contact and another situation, in the situation I have the values waiting, progress and completed.
I search this table with fecth_array
So far so good but when I select one of the options I am not able to record and send the variable to the contact table. I ask for your help because I’ve been in this dilemma for days
Note: When I click the change button it is not sending the variable that the user selected but the last item of the array that is completed then even if I choose progress this taking the variable completed.
echo'<td><select name="sitprot" id="sitprot">';
$sql="select * from situacao"; // neste permite mostrar e alterar e as opções para ser gravado no banco.
$resultado2=mysql_query($sql);
while($dados1=mysql_fetch_array($resultado2)){
$marca1=$dados1['situ'];
echo "<option value='$marca1'>$marca1</option>";
echo $marca1;
}
echo '</select> <td>';
echo '<td><a href="status1.php?id='.$info[id].'& situ='.$marca1.'">Alterar</td>';
If you are starting in PHP start not using the mysql functions_*, Why should we not use mysql type functions_*?. do you send by link? or have some more code there?
– rray
thanks for the tip of the functions I will switch to PDO or msqli as suggested , yes use the link even passing the variables id and situ as shown in the last line .
– Leonardo Lopes
There’s another while inside that?
– rray
Leonardo, either you use a form and a button to make a Ubmit, or you do as the Kaduamaral did in his reply. With form and a Ubmit button would be a little simpler.
– Antonio Alexandre