Each match has a MoTM so the database is querying how many times the Member ID is listed as the MoTM (2 queries because the league & cup are logged in different tables) [code]$motm1_query = mysql_query("SELECT id, clan1, clan2, date FROM fixtures_results WHERE(motm1='".$member['id']."' or motm2='".$member['id']."') ORDER BY date DESC, id DESC"); $motm2_query = mysql_query("SELECT id, clan1, clan2, date FROM cup_results WHERE(motm1='".$member['id']."' or motm2='".$member['id']."') ORDER BY date DESC, id DESC");[/code] Then the MoTM is the total of both queries. This just generates a number. [code]$motm = mysql_num_rows($motm1_query) + mysql_num_rows($motm2_query);[/code] At the moment my script lists the Players (alphabetical order) then lists the no. of MoTM awards next to the Player name. I want the MoTM awards to be listed in order (descending order) with the player name next to it. I've stripped a bit of the code out to make it easier on the eye.. [code]<table width="100%"> <tr> <td colspan="2" class="dark"><div align="center"><b>Players</b></div></td> </tr> <tr> <td class="dark"><b>Username</b></td> <td class="dark"><div align="center"><b>MoTM</b></div></td> </tr> <?php $member_query = mysql_query("SELECT * FROM users WHERE(accept='1') ORDER BY id ASC"); while($member = mysql_fetch_array($member_query)) { if(get_magic_quotes_runtime()) { $member['username'] = stripslashes($member['username']); } $motm1_query = mysql_query("SELECT id, clan1, clan2, date FROM fixtures_results WHERE(motm1='".$member['id']."' or motm2='".$member['id']."')"); $motm2_query = mysql_query("SELECT id, clan1, clan2, date FROM cup_results WHERE(motm1='".$member['id']."' or motm2='".$member['id']."')"); $motm = mysql_num_rows($motm1_query) + mysql_num_rows($motm2_query); ?> <tr> <td class="light"><a href="user_view.php?u=<?php echo $member['id']; ?>"><?php echo $member['username']; ?></a></td> <td class="light"><div align="center"><?php echo $motm; ?></div></td> </tr> <?php } ?> </table>[/code]