diff --git a/code/highscores.php b/code/highscores.php index aed4cf7..21da23a 100644 --- a/code/highscores.php +++ b/code/highscores.php @@ -88,54 +88,51 @@ - -
- - - -
- query($sql); - $a=$result->fetchArray(); - - if($a==false) - { - $phrase= "Il n'y a pas encore de score pour ce mode de jeu."; - } - else - { - $phrase="Le record est ".$a[0].", tenu par ".$a["player"]; - while ($row = $result->fetchArray()) { - $phrase=$phrase.", ".$row["player"]; - } - + $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select max(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')'; } + else + { + $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select min(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')'; + } + $result = $database->query($sql); + $a=$result->fetchArray(); - echo "

".$phrase."

"; - echo ""; - echo ""; - echo ""; - echo ""; + if($a==false) + { + $phrase= "Il n'y a pas encore de score pour ce mode de jeu."; } - ?> + else + { + $phrase="Le record est ".$a[0].", tenu par ".$a["player"]; + while ($row = $result->fetchArray()) { + $phrase=$phrase.", ".$row["player"]; + } + +} + + echo "

".$phrase."

"; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
+ + +
+ +