[SOLVED] Ordering results into groups
Posted: Mon Jun 28, 2004 10:30 am
I have a database with tests grouped into Suites, groups, then tests. I would like to be able to output them in the following format onto a web page
and so on.
I have tryed the following
but with no luck.
I am not looking for someone to give me the code, just to give me an idea of how to start (as the above only ouputs the suites)
Cheers in advance - LinkJames
Code: Select all
| Suite 1 | Group 1 | test 1 |
--------------------------------
| test 2 |
| test 3 |
| test 4 |
| test 5 |
--------------------------------
| Suite 1 | Group 2 | test 1 |
--------------------------------
| test 2 |
| test 3 |
| test 4 |
| test 5 |
--------------------------------
| Suite 2 | Group 1 | test 1 |
--------------------------------
| test 2 |
| test 3 |
| test 4 |
| test 5 |
--------------------------------I have tryed the following
Code: Select all
$selsuite = mysql_query("SELECT 'suite' FROM `tests`");
while ($resarraysuite = mysql_fetch_array($selsuite))
{
$selgroup = mysql_query("SELECT group FROM `tests'");
while ($resarraygroup = mysql_fetch_array($selgroup))
{
$seltest = mysql_query("SELECT test FROM `tests` ORDER BY 'suite'");
while ($resarraytest = mysql_fetch_array($seltest))
{
$suite = $resarraysuite['suite'];
echo $suite;
$group = $resarraygroup['group'];
echo $group;
$test = $resarraytest['test'];
echo $test;
Echo "<br>";
}
}
}I am not looking for someone to give me the code, just to give me an idea of how to start (as the above only ouputs the suites)
Cheers in advance - LinkJames