<?php
$sql= «select posicio, concat (Nom, ‘ ‘, Llinatges), (select nom from clubs where id_club=e.id_club), sum(punts) as puntuacio from ranking as r, esportistes as e
where e.dni = r.dni
and tipus=’M’
group by e.dni
order by puntuacio DESC»;
$result = mysql_query($sql,$link)or die(mysql_error());
$total_resultats = mysql_num_rows($result);
mysql_close($link);
echo «<table style=’font-size:11px; font-family:Times New Roman’>»;
echo «<tr >»;
echo «<td width=75><strong>POSICIÓ</strong></td>»;
echo «<td width=250><strong>NOM</strong></td>»;
echo «<td width=250><strong>CLUB</strong></td>»;
echo «<td width=125><strong>PUNTUACIÓ</strong></td>»;
echo «</tr>»;
$i=1;
while ($row = mysql_fetch_array($result)) {
echo «<tr height=10 >»;
echo «<td >».$i.»</td>»;
echo «<td>».($row[1]).»</td>»;
echo «<td>».($row[2]).»</td>»;
echo «<td>».($row[3]).»</td>»;
echo «</tr>»;
$i++;
}
echo «</table>»;
?>
FETRIB Federació de Triatló de les Illes Balears