Fonctionnement d'une function
Posté : 01 juin 2012, 06:36
Bonjour,
alors voilà dans le but de crée un classement, j'ai une petite erreur,
Je vous remerci
alors voilà dans le but de crée un classement, j'ai une petite erreur,
Voila le tableau :Notice: Undefined variable: Royaume in C:\wamp2\www\Rank_Player.php on line 45
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td border="1"><center><div class="bloc2"><div class="tng6"><?php echo $data['name']; ?></div></div></center></td>
<td border="1"><center><div class="bloc2"><div class="tng6"><?php echo $data['level']; ?></div></div></center></td>
<td border="1"><center><div class="bloc2"><div class="tng6"><?php echo $Job = $i[$data['job']]; ?></div></div></center></td>
<td border="1"><center><div class="bloc2"><div class="tng6"><?php $ID = $data['account_id']; echo Empire($ID, $Royaume); ?></div></div></center></td>
</tr>
</table>
Et voici ma function Empire.<?php
function Empire($ID, $Royaume){
$xSql = mysql_query("SELECT * FROM player_index WHERE id='".$ID."'")or die(mysql_error());
$xRes = mysql_fetch_array($xSql);
if ($xRes['empire'] == 1){
if ($Royaume == 1){echo "Shinsoo' />";}Else{echo "Shinsoo";}
}
if ($xRes['empire'] == 2){
if ($Royaume == 1){echo "Chunjo' />";}Else{echo "Chunjo";}
}
if ($xRes['empire'] == 3){
if ($Royaume == 1){echo "Jinno' />";}Else{echo "Jinno";}
}
}
?>
L'erreur à la ligne 45 Correspond a la Ligne <td border="1"><center><div class="bloc2"><div class="tng6"><?php $ID = $data['account_id']; echo Empire($ID, $Royaume); ?></div></div>
Je vous remerci