ok heres my code:
<h4>5 Most Active Pilots:</h4>
(Based on No. of pireps filled)
<br>
<table cellspacing="1" bordercolor=#000000 border=1>
<tr><td>Pilot ID</td><td>Pilot Name</td><td># of Pireps</td></tr>
<?php
$query = "SELECT max( pireps ) AS pireps, Name , ID FROM $table1 GROUP BY pireps LIMIT 5";
$result = mysql_query($query)or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
$id = $row['ID'];
$name = $row['Name'];
$pireps = $row['pireps'];
$trow = "<tr><td>$id</td><td>$name</td><td>$pireps</td></tr>";
echo $trow;
}
?>
</table>
bassicaly i want it to create the table and list the top 5 members based on # of pireps -> $pireps, but you cant seem to use ORDER BY when you use MAX() so how can i get it to work?