".$ph."";
$toDisp=5;
if(isset($_POST["game_mode"]) && $_POST["game_mode"]!="" && $_POST["difficulty"]!="" && $_POST["dotsAmount"]!="" && $_POST["pause"]!="")
{
$db_game_mode=$_POST["game_mode"];
$db_difficulty=$_POST["difficulty"];
$db_dotsAmount=$_POST["dotsAmount"];
$db_pause=$_POST["pause"];
}
else
{
$db_game_mode="5p";
$db_difficulty="easy";
$db_dotsAmount=$_COOKIE["dotsAmount"];
$db_pause=$_COOKIE["pause"];
}
if(stristr($db_game_mode, "p") === FALSE)
{
$sql='select score, player from score where game_mode="'.$db_game_mode.'" and difficulty="'.$db_difficulty.'" and dots_amount='.$db_dotsAmount.' and pause='.$db_pause.' order by score desc limit '.$toDisp;
$unit="points";
}
else
{
$sql='select score, player from score where game_mode="'.$db_game_mode.'" and difficulty="'.$db_difficulty.'" and dots_amount='.$db_dotsAmount.' and pause='.$db_pause.' order by score asc limit '.$toDisp;
$unit="secondes";
}
$result = $database->query($sql);
$a=$result->fetchArray();
if($a==false)
{
$phrase= "Il n'y a pas encore de score pour ce mode de jeu.";
}
else
{
$phrase="1° ".$a["player"].", ".$a[0]." ".$unit;
$cpt=2;
while ($row = $result->fetchArray()) {
$phrase=$phrase."".$cpt."° ".$row["player"].", ".$row["score"]." ".$unit;
$cpt++;
}
}
echo "