Thanks for your help so far,
It isn't getting MySQL to sort it, as MySQL just returns me one result for the specific person, in this format:
ID Number, Name, Subject1, Subject2, Subject3, Subject4 e.t.c.
What I want to do is sort the order I print them out to the browser, the code I am using is basically this (I've taken out the bits that have nothing to do with sorting them):
$result = mysql_query ("SELECT * FROM Results WHERE ID = '$id'");
$row = mysql_fetch_array($result);
asort ($row);
reset ($row);
while (list ($key, $val) = each ($row)) {
$sub = "";
if ($key == "Maths") { $sub = "Maths"; }
if ($key == "ELang") { $sub = "English Language"; }
if ($key == "ELit") { $sub = "English Literature"; }
if ($key == "French") { $sub = "French"; }
if ($key == "Spanish") { $sub = "Spanish"; }
if ($key == "German") { $sub = "German"; }
if ($key == "IT") { $sub = "I.T."; }
if ($key == "Hist") { $sub = "History"; }
if ($key == "Bio") { $sub = "Biology"; }
if ($key == "Phys") { $sub = "Physics"; }
if ($key == "Chem") { $sub = "Chemistry"; }
if ($key == "Geog") { $sub = "Geography"; }
if ($key == "DT") { $sub = "D.T."; }
if ($key == "Art") { $sub = "Art"; }
if ($key == "RS") { $sub = "R.S."; }
if ($key == "Latin") { $sub = "Latin"; }
if ($key == "Music") { $sub = "Music"; }
if ($key == "Other") { $sub = "Other"; }
if ($sub != "") {
if ($val != "") {
if ($val != "1") { print "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"4\">$sub: <font color = \"#0000FF\">$val</font></font></p>"; } } }
}
This works, and produces me a list, e.g.:
History: A
Maths: A
French: A*
Geography: B
Music: D
What I want to do is find some way of sorting it so that the A grade for French goes before the A grades for History and Maths as A is better than A (This is for the UK GCSE system).
Thanks,
Alex Brett
alex_brett@hotmail.com