Hi...
I'm working on a script right now and am not able to figure out how to resolve a problem I've run into.
What I have is below:
// Create Mission Selection List //
$mis = "SELECT mission, target, date, type FROM briefing ORDER BY mission";
$mis_result = @mysql_query($mis, $connect) or die(mysql_error());
while ($row = mysql_fetch_array($mis_result)) {
$mission = $row['mission'];
$tgt = $row['target'];
$mis_date = $row['date'];
$type = $row['type'];
// Create Bomber Per Mission Loss List //
$blost = "SELECT plane_name, plane_squadron FROM mission WHERE plane_status > '1' AND mission_no = '$mission' ORDER BY mission_no";
$blost_result = @mysql_query($blost, $connect) or die(mysql_error());
$num_blost = mysql_num_rows($blost_result);
while ($row = mysql_fetch_array($blost_result)) {
$plane = $row['plane_name'];
$squad = $row['plane_squadron'];
if($num_blost > "0") {
$display_bombers .= "
<tr>
<td width=30%></td>
<td width=70%><font face=\"Century Gothic\" size=2 color=#000000>$plane, $squad</font></td>
</tr>";
} else {
$display_bombers = "
<tr>
<td width=30%></td>
<td width=70%><font face=\"Century Gothic\" size=2 color=#000000>No Bombers Lost.</font></td>
</tr>";
}
}
$display_losses_list .= "
<tr>
<td width=30% align=left><a href=group_losses_stat.php?mission=$mission><font face=\"Century Gothic\" size=3 color=#30341B><b>Mission #$mission</b></font></a>
<td wdith=70% align=left><font face=\"Century Gothic\" size=3 color=#30341B><b>(</b><i><font size=2 color=red>$tgt ($type), $mis_date</font></i><b>)</b></font><td>
</tr>
$display_bombers";
}
What I WANT to happen is that under each "Mission" result, the planes lost on that mission alone are listed.
What's happening is that for each Mission, the planes from that mission PLUS the planes from all previous missions are shown. So, for example, this is what I'm getting:
Mission #1 ([target], [target type])
Bomb Easy
Mission #2 ([target], [target type])
Bomb Easy
Radical Boys
Flak Bait
Mission #3 ([target], [target type])
Bomb Easy
Radical Boys
Flak Bait
Good Enough
To Berlin
How do I "clear" the results so on the next Mission display it only shows the planes relevant to that mission?