Hi Guys,
I have a system in place which looks at a $secondname variable on my php template then that looks at the database to see how many times the $secondname appears in the variables below:
<?php
$sql = "SELECT COUNT(*) FROM game WHERE game.shirtone = '$secondname' OR game.shirttwo = '$secondname' OR game.shirtthree = '$secondname' OR game.shirtfour = '$secondname' OR game.shirtfive = '$secondname' OR game.shirtsix = '$secondname' OR game.shirtseven = '$secondname' OR game.shirteight = '$secondname' OR game.shirtnine = '$secondname' OR game.shirtten = '$secondname' OR game.shirteleven = '$secondname' ";
$res1 = mysql_query($sql) or die(mysql_error());
echo mysql_result($res1, 0);
?>
Want to modify that though, so for example it looked through all the $secondname values in my 'game' table and outputted them in order of how many times they have appeared, so for example:

I'm not sure how i'd go about outputting the $secondname in apparance order?