Hi !
I have a simple mysql query:
$resultat = mysql_query('SELECT id, teamname, teamrank FROM teams ORDER BY teamrank, teamname ASC');
echo("<table cellspacing=\"0\" cellpadding=\"0\" width=\"500\" class=\"edittable\">
<tr><th>Teamname</th><th>Team rank</th></tr>");
while ($row = mysql_fetch_array($resultat))
{
echo("<tr>");
echo("<td>" . $row["teamname"] . "</td>");
echo("<td>" . $row["teamrank"] . "</td>");
echo "</tr>";
}
echo("</table>");
?>
It outputs like this:
team 1 rank 1
team 2 rank 1
team 3 rank 2
team 4 rank 2
and so on.
I would like to format the output like this:
team 1 rank 1
team 2 rank 1
team 3 rank 2
team 4 rank 2
Grouping the output according to team rank. Putting each group in it's own tablecell.
Any suggestions ? I'm not very good at this, and I have tried to search for solutions, but always ends up with something that is way too complicated for me. :queasy:
Thanks in advance.