le 22/04/2009 à 21:46
Evaluation IF
Merci beaucoup, c'était bien cela :D !
<?php
$scores = mysql_query("SELECT * FROM highscores") or die(mysql_error());
while ($donnees = mysql_fetch_array($scores) )
{
echo '<style type="text/css">
p{background-image : url("lol.png");
color : orange; padding : 20px;
margin-right : 00px;
margin-top : 0px;
margin-bottom : 0px;}
span{background-color : black;
margin-left : 100px;
padding : 5px;
font-family : "Hobo std", "Comic sans ms", "serif";}</style> ';
echo '<span><font color="white">';
echo $donnees['map'],'</font></span>' ,'<p></br>';
$map ='traiter/'.$donnees['map'].'.mqhs';
if (file_exists($map))
{
$file = fopen($map, "r+");
$ligne = fgets($file);
echo $donnees['score4']; //Affiche 6
echo $ligne;
//Affiche 6
If $ligne != $donnees['score4'] //Il rentre dans le code à mon grand desespoire !!!
{$i = 0;
for ($j = 0; $j <= 3; $j++)
{
$score = 'score'.$j;
$i = $j + 1;
$score1 = 'score'.$i;
mysql_query("UPDATE highscores SET $score = $score1 WHERE map = '".$donnees['map']."'");
}
$j = 4;
$score = 'score'.$j;
mysql_query("UPDATE highscores SET $score = $ligne WHERE map = '".$donnees['map']."'");
}
fclose($file);
//unlink($map);
}
Chargement en cours