|
I did not include my question in the previous message
I have taken this from another example I saw of where one drop down
list is dependent on the selection of the previous. I can't get the
data to show up in the second menu after I select the first. Anyone
see what I am doing wrong?
Thanks, Jim
<?php
include('./common_db.inc');
$link_id = db_connect();
mysql_select_db("test_aces_data");
?>
<form name=carform action=
<?php echo $_SERVER['PHP_SELF'];
?> method=post>
<?php
$query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
CQ_data ORDER BY make_id");
echo '<select name=make
onchange="document.carform.submit()"'.">"."\n";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make</option>'."\n";
}
while(list($make_id) = mysql_fetch_row($query))
{
echo '<option value='.$make_id;
if (isset($make)&& $make_id == $make)
{
echo " selected";
}
echo '>'."$make_id".'</option>'."\n";
}
echo '</select>'."\n";
echo '<select name=model
onchange="document.carform.submit()"'.">"."\n";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make First</option>'."\n";
}
else
{
$result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
CQ_data where make_id='$make' ORDER BY NAME");
echo '<option value=null selected>Choose a Model</option>'."\n";
while(list($model_id) = mysql_fetch_row($result))
{
echo '<option value=' . $model_id;
if ($model_id == $model)
{
echo " selected";
}
echo '>$model_id</option>'."\n";
}
} echo '</select>'."\n";
?> |