I need help finishing this ladder for my school's basketball teams. Everything works fine but I want to show the teams with the most points on top of the ladder (DESC). Would it be possible the get some help? I have tried a few things but I am unable to figure this one out. Here is my page :
Code: Select all
<?php
$liaison = mysql_connect ("#", "#", "#");
mysql_select_db("#");
$sql = "select * from #";
if (isset($_REQUEST["ordre"])) {
$sql .= " order by ".mysql_real_escape_string($_REQUEST["ordre"]) ;
}
$user = mysql_query($sql);
?>
<html>
<head>
<title>School Teams 2010-2011</title>
<style type="text/css">
#a {
position: absolute;
top: 0px;
left:0px;
z-index: 2;
}
td.user_info { border: 1px; border-color: #FFF;
border-style: solid; }
</style>
</head>
<body>
<div id="a">
<table border="0" width="875px" cellspacing="0">
<tr>
<td class="user_info" bgcolor="#65a7ce"><span style="color: #FFF; padding-left: 5px"><strong>Player</strong></span></td>
<td class="user_info" bgcolor="#65a7ce"><span style="color: #FFF; padding-left: 5px"><strong>Courriel</strong></span></td>
<td class="user_info" bgcolor="#65a7ce"><span style="color: #FFF; padding-left: 5px"><strong>W</strong></span></td>
<td class="user_info" bgcolor="#65a7ce"><span style="color: #FFF; padding-left: 5px"><strong>L</strong></span></td>
<td class="user_info" bgcolor="#65a7ce"><span style="color: #FFF; padding-left: 5px"><strong>Pts</strong></span></td>
<?php while (($ladder_1v1 = mysql_fetch_assoc ($user))
!== false): ?>
<tr>
<td class="user_info" bgcolor="#dcebfe" style="padding:5px">
<?php echo $ladder_1v1["user"]; ?>
<!-- mod // -->
<a href="modifier.php?id=<?php echo $ladder_1v1["id"]; ?>">
[Modifier]</a>
<!-- mod // -->
<!-- delete // -->
<a href="supprime.php?id=<?php echo $ladder_1v1["id"]; ?>">
[Suprimer]</a>
<!-- delete // -->
</td>
<td class="user_info" bgcolor="#dcebfe" style="padding:5px">
<?php echo $ladder_1v1["email"]; ?>
</td>
<td class="user_info" bgcolor="#dcebfe" style="padding:5px">
<?php
echo $ladder_1v1["win"];
?>
</td>
<td class="user_info" bgcolor="#dcebfe" style="padding:5px">
<?php
echo $ladder_1v1["loss"];
?>
</td>
<td class="user_info" bgcolor="#dcebfe" style="padding:5px">
<?php
$pts = ($ladder_1v1["win"] * 5 ) - ($ladder_1v1["loss"] * 5);
echo $pts;
?>
</td>
</tr>
<?php endwhile ?>
</table>
</div>
</body>
</html>
<?php
mysql_close($liaison);
?>