I have created a mysql table and populated the fields with this single line of values for year, make, model, style, part, price:
(1, '1992', 'Chevrolet', 'Caprice', 'Station Wagon', 'Front Windshield', 359);
With this code, I was able to populate the first field of a dropdown box with the year 1992.
<?
mysql_connect ("host", "user", "password");
mysql_select_db ("db");
$query = "SELECT DISTINCT(year) FROM prices ORDER BY year";
$result = mysql_query($query);
$num = mysql_numrows($result);
echo "<font face=\"Arial\" color=\"red\">Year:</font><br>";
echo '<select name="$year">';
echo '<option value="$year" selected>Select Year</option>';
while ($row=mysql_fetch_array($result)) {
$year = $row['year'];
echo "<option value='$year'>$year</option>";
}
echo '</select><p>';
$i++;
echo "</select><p>";
?>
Big step for me, but what I want to do is add a dropdown box for each remaining field that is dynamically filled by available values decided by the previous dropdown selection. Ultimately, all that will be left is price. I know this can be done using Javascript and php. It would really help me to see a fairly complete code example.