I need a form with list box as make,model and version .When make is selected ,corresponding models for the make is displayed for selected and so on for version too .I can display make by using this code .But don't know how to populate the model field for related make and further for versions. 😕
<html>
<body>
<?php
$host = 'localhost';
$user = 'root';
$pass = 'password';
$db = 'wordpress';
$con = mysql_connect($host,$user,$pass) or die('Error: Could not connect');
mysql_select_db($db) or die ('Error: Could not select database');
$query = "SELECT distinct make FROM wp_car_detail";
$result = mysql_query($query);
echo "<select name='make'>\n";
while($row = mysql_fetch_assoc($result))
{
echo "<option >{$row['make']}</option>\n";
}
echo "</select>\n";
?>
</body>
</html>
Structure of my table wp_car_detail is like..
id make model version ---
2 make1 model1.1 v1.1
4 make1 model1.2 v1.1
6 make2 model2.1 v 2.1
7 make2 model2.2 v 2.2
8 make2 model2.3 v 2.3
.When the submit button is pressed ,the selected make ,model and year field is passed in the function for displaying feature of the selected car .like --
Car_detail($make,$model,$year);
Can you tell me how to fetch the selected values in order to pass it to the function ? 😕