So, I had a problem getting the value from the dropdown in HTML to a variable so that I can execute the mysql query. It will be a little difficult to explain, but I will do my best. (Feel free to correct my English or my expressions to make the question more specific and understandable).
So, I have this dropdown that gets its values from mysql query.
<td>Designação atual :</td> <td><select name="desig_act" id="desig_act">
<?php
while ($row2 = mysql_fetch_assoc($result4)) {
echo "<option size=30 value=".$row2['new_name_freg'].">".$row2["new_name_freg"]."</option>";
}
?>
</select>
This "connects" to this request:
$sql4 = ("SELECT DISTINCT new_name_freg FROM freguesias WHERE codg_cc = '$pesq'");
$result4 = mysql_query($sql4, $link);
This query will populate a drop-down list with values. What I want to do is fill out another drop down list. For examples, I select a list of countries, and when I select a country, it should display all its cities in another drop-down list.
I was looking for guys. Believe me.
P.s: , , , , , , . , . , , .