Salut à tous voila je cherche un peu d'aide sur un petit prob que j'ai avec un classement pour un tournoi.
J'ai choisi de trier mon classement d'abord par nbpts en DESC puis la difference en DESC aussi
Seul probleme le script se trompe avec les nombres superieur et inferieur à 0
Par exemple 2 personnes qui on 0points avec le meme nbr de match et comme difference chacun :
Martin -36 et Jacques -52
Ba Martin se retrouve en dernier pourquoi sa je ne comprend pas
Et si je met pour la difference ASC c'est les nbrs superieur avec lesquels il se goure.
Autre truc que je pige pas jai la 3eme et 4eme lignes ou la 1ere colonne se decale par rapport aux autres.Bizard!!
Si quelqun à une idée je l'en remercie d'avance
Voici la table et le ptit script
CREATE TABLE `a_equipe` (
`idequipe` int(11) default '0',
`nom` varchar(150) collate latin1_german2_ci default NULL,
`nbmatch` int(11) default '0',
`nbpts` int(11) default '0',
`nbvic` int(11) default '0',
`nbnul` int(11) default '0',
`nbdef` int(11) default '0',
`nbpg` int(11) default '0',
`nbpp` int(11) default '0',
`idtournoi` int(11) default '0',
`nbforfait` int(11) default '0',
`nbdiff` char(20) collate latin1_german2_ci default '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
INSERT INTO `a_equipe` VALUES ('1','Guisxou','3','3','1','0','2','168','210','1','0','-42');
INSERT INTO `a_equipe` VALUES ('2','LuckyLuke','2','6','2','0','0','169','107','1','0','62');
INSERT INTO `a_equipe` VALUES ('3','reba','2','0','0','0','2','104','145','1','0','-41');
INSERT INTO `a_equipe` VALUES ('4','square','0','0','0','0','0','0','0','1','0','0');
INSERT INTO `a_equipe` VALUES ('5','Vince','1','0','0','0','1','32','57','1','0','-25');
INSERT INTO `a_equipe` VALUES ('6','Toto','2','6','2','0','0','130','84','1','0','46');
///////////////////////////////////////////////////////////////////
<table width="710" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="10"> </td>
<td><table width="700" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#603030">
<tr bgcolor="#604040">
<td width="200" align="center" class="menu">Nom Joueur </td>
<td width="50" align="center" bgcolor="#604040" class="menu">Pts</td>
<td width="50" align="center" bgcolor="#604040" class="menu">Joue</td>
<td width="50" align="center" bgcolor="#604040" class="menu">V</td>
<td width="50" align="center" bgcolor="#604040" class="menu">N</td>
<td width="50" align="center" bgcolor="#604040" class="menu">F</td>
<td width="50" align="center" bgcolor="#604040" class="menu">D</td>
<td width="50" align="center" bgcolor="#604040" class="menu">PG</td>
<td width="50" align="center" bgcolor="#604040" class="menu">PP</td>
<td width="50" align="center" bgcolor="#604040" class="menu">Diff</td>
</tr>
</table></td>
</tr><tr>
<td width="10" class="menu">1</td>
<td rowspan="6">
<?php
require "include/config.php";
$idtournoi = mysql_real_escape_string($_GET['idtournoi']);
$sql = "SELECT idequipe,nom,nbpts,nbpg,nbpp,nbvic,nbdef,nbnul,nbmatch,nbforfait,nbdiff from a_equipe WHERE idtournoi= '".$_GET['idtournoi']."' ORDER BY nbpts DESC, nbdiff DESC";
$req = mysql_query($sql);
while ($telech = mysql_fetch_array($req))
{
$nom = stripslashes($telech['nom']);
$nbpts = stripslashes($telech['nbpts']);
$nbpg = stripslashes($telech['nbpg']);
$nbpp = stripslashes($telech['nbpp']);
$nbvic = stripslashes($telech['nbvic']);
$nbnul = stripslashes($telech['nbnul']);
$nbdef = stripslashes($telech['nbdef']);
$nbmatch = stripslashes($telech['nbmatch']);
$nbforfait = stripslashes($telech['nbforfait']);
$nbdiff = stripslashes($telech['nbdiff']);
$idequipe = stripslashes($telech['idequipe']);
?><table width="700" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#603030">
<tr>
<td width="200" align="center" bgcolor="#603030" class="aff"><?php echo '<a href="index.php?guisx=voirmbr&nomjoueur='.$nom.'">'.$nom.'</a>'; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbpts; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbmatch; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbvic; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbnul; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbforfait; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbdef; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbpg; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbpp; ?></td>
<td width="50" align="center" bgcolor="#603030" class="aff"><?php echo $nbdiff; ?></td>
</tr></table><?php } ?></td>
</tr><tr>
<td width="10" class="menu">2</td>
</tr><tr>
<td width="10" class="menu">3</td>
</tr><tr>
<td width="10" class="menu">4</td>
</tr><tr>
<td width="10" class="menu">5</td>
</tr><tr>
<td width="10" class="menu">6</td>
</tr>
</table>