Current location: Hot Scripts Forums » Programming Languages » PHP » trouble with the display of results and drop down list..


trouble with the display of results and drop down list..

Reply
  #1 (permalink)  
Old 07-11-05, 11:38 AM
SummerL SummerL is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
trouble with the display of results and drop down list..

I have got this drop down list populated from the database, upon selection it should display another drop down list as well as diplay of results in table form..
The thing is the second drop down list and the results weren't displayed Anyone know why? Thanks in advance..

first drop down list that is populated from the database
Code:
// 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);
displaying of results upon selection of first drop down list
Code:
<?php 
if (isset($_POST['AircraftType'])) 
{ 
$queryAircraftType = "SELECT AircraftType FROM report where aircrafttype='".$_POST['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>"; 
} 
} 
          
?>
second drop down list populated from first drop down
Code:
<?php 
if (isset($_POST['AircraftType'])) 
{ 
$queriesAircraftType = "SELECT AircraftTailNo FROM report where aircrafttype='".$_POST['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>"; 
} 
} 
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in displaying results in table using a drop down SummerL PHP 2 07-05-05 01:44 PM
posting of results script Sir-ihlatrebon Script Requests 0 02-17-04 12:46 PM
results page to display prev/next php-learner PHP 11 01-12-04 10:40 AM


All times are GMT -5. The time now is 12:33 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.