I can get the first two drop down list to work, now the thing is i can't get it to display the results in table after the selections of the drop down lists.. that is to say after the user select the value from the drop down lists.. it should display results onto the table.. How should i do it anyone know?
Initial Drop down list
// get the aircraft type
$queryAircraftType = "SELECT distinct AircraftType FROM report";
$resultAircraftType = mysql_query($queryAircraftType) or die ("couldn't execute query.");
$row_num_links_mainAircraftType =mysql_num_rows ($resultAircraftType);
<?php while($rowAircraftType = mysql_fetch_array($resultAircraftType)) {
if($rowAircraftType['AircraftType']==$_GET['AircraftType'])
{
echo "<option selected value='$rowAircraftType[AircraftType]'>$rowAircraftType[AircraftType]</option>"."<BR>";}
else
{
echo "<option value='$rowAircraftType[AircraftType]'>$rowAircraftType[AircraftType]</option>";
}
}
?>
</select>
second drop down list populated from initial drop down list
<?php
if (isset($_GET['AircraftType']))
{
$queriesAircraftType = "SELECT AircraftTailNo FROM report where aircrafttype='".$_GET['AircraftType']."'";
//echo $query;
$resultsAircraftType = mysql_query($queriesAircraftType) or die ("couldn't execute query ".mysql_error());
if ($resultsAircraftType)
{
echo "<select name=\"AircraftTailNo\">";
while ($rowsAircraftType = mysql_fetch_array($resultsAircraftType))
{ extract($rowsAircraftType);
echo "<option value=\"".$rowsAircraftType['AircraftTailNo']."\">".$rowsAircraftType['AircraftTailNo']."</option>";
}
echo "</select>";
}
}
?>
Display results
<?php
$queryAircraftType = "SELECT * report where aircrafttype='".$_GET['AircraftType']."'";
//echo $query;
$resultAircraftType = mysql_query($queryAircraftType) or die ("couldn't execute query ".mysql_error());
while ($row = mysql_fetch_array($resultAircraftType))
{
extract($row);
echo "<tr>
<td>$row[ReportID]</td>
<td>$row[AircraftTailNo]</td>
<td>$row[AircraftType]</td>
<td>$row[ServicingType]</td>
<td>$row[AirFrameHours]</td>
<td>$row[DefectInfo]</td>
<td>$row[Rectifications]</td>
<td>$row[Comments]</td>
<td>$row[RelatedDoc]</td>
<td>$row[UserID]</td>
</tr>";
}
}
?>