I have a query that produces an athletes ranking list across various events by performance. I would like to create a hyperlink to each athlete to show full results- the query only shows best performance over the season- so would like the hyperlink to bting up all athletes performances, showing date, meeting and performance-this is to overcome I am having where aggregate function at the moment produces results but brings up erroneous dates and meetings as I have non-aggregate ungrouped fields. Creating a hyperlink to each athlete would be the solution as at the moment I only show best, and it would be good if all results for an individual could be seen- whioch can be done by a seperate query. But I am stuggling to create a hyperlink using fname and sname fileds- which are the identifiers for an individual. It is a flat table, so no athlete has an individual ID at the moment.
<?php
$maxRows = 300;
$pageNum = 0;
if (isset($HTTP_GET_VARS['pageNum'])) {
$pageNum = $HTTP_GET_VARS['pageNum'];
}
if (isset($GET['event'])) {
$ap = $GET['event'];
}
mysql_select_db($database_dbathletics, $dbathletics);
$query = "SELECT MIN( perf ) AS minperf, MIN( mid ) AS minmid, MAX( perf2 ) AS maxperf2, event, date,meet, fname, sname, club FROM indoor200506 WHERE event = '$ap' GROUP BY fname, sname, club ORDER BY minperf,minmid,maxperf2 desc";
$result = mysql_query($query) or die(mysql_error());
$numofrows = mysql_num_rows($result);
?>
<
<?php
echo "<TABLE BORDER=\"1\">\n";
echo "<TR bgcolor=\"lightblue\"><TD>Date</TD><TD>Meeting</TD><TD>Event</TD><TD>First Name</TD><TD>Surname</TD><TD>Club</TD><TD>Perf</TD><TD>Middle-Long Perf</TD><TD>Field</TD></TR>\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_assoc($result);
if($i % 2) {
echo "<TR bgcolor=\"#cccccc\">\n";
} else {
echo "<TR bgcolor=\"#ffffff\">\n";
}
echo "<TD>".$row['date']."</TD><TD>".$row['meet']."</TD><TD>".$row['event']."</TD><TD>".$row['fname']."</TD><TD>".$row['sname']."</TD><TD>".$row['club']."</TD><TD>"
.$row['minperf']."</TD><TD>".$row['minmid']."</TD><TD>".$row['maxperf2']."</TD>\n";
echo "</TR>\n";
}
/
echo "</TABLE>\n";
?>