24-10-2008, 01:29 PM
Code PHP :
<?php
$pseudo=mysql_real_escape_string($_SESSION['pseudo']);
$sql=sprintf("SELECT COUNT(*) FROM `infosjeu` WHERE `points` <=(SELECT `points` FROM `infosjeu` WHERE `pseudo`='%s')", $pseudo);
$req=mysql_query($sql) or die(mysql_error());
NB il est possible de cinder en 2 la requete vu qu'il ya cette sous requete...
Code PHP :
<?php
$pseudo=mysql_real_escape_string($_SESSION['pseudo']);
$sql=sprintf("SELECT `points` FROM `infosjeu` WHERE `pseudo`='%s'", $pseudo);
$req=mysql_query($sql) or die(mysql_error());
$ligne=mysql_fetch_row($req);
$sql=sprintf("SELECT COUNT(*) FROM `infosjeu` WHERE `points` <='%d'", $ligne[0]);
$req=mysql_query($sql) or die(mysql_error());
$ligne=mysql_fetch_row($req);
$place=$ligne[0];