in mysql i have a table called cars thet have two fields name and Id
what i want is in my page to have two dropdown menus and when i select a car in first dropdown menu in the
second dropdown menu to opear the id of the selected car
i have tryed in somany ways but nothing so i hope you can help ....
thnx.
dropdown menu hepl
Moderator: General Moderators
page 1:
page 2:
Code: Select all
echo "<select name=\"carMake\" onChange=\"this.form.submit()\">
<option value=\"1\">Ford</option>
<option value=\"2\">Honda</option>";Code: Select all
$result = mysql_query("select `models` from `cars` where `makeId` = {$_POST['carMake']}");
echo "<select name=\"carModel\">";
while($row = mysql_fetch_assoc($result))
{
echo <option value=\"{$row['models']}\">{$row['models']}</option>";
}
echo "</select>";