<?
$sql = "SELECT * FROM lao_membre";
$req = mysql_query($sql) or die ("Erreur Recupération infos".mysql_error());
while($contenu = mysql_fetch_array ($req))
{
echo "<tr>";
echo "<td height='17' class='table_light' width='18'> </td>";
if ($contenu[pays] == 'France')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/fr.gif'></td>";
}
else if ($contenu[pays] == 'Angleterre')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/uk.gif'></td>";
}
else if ($contenu[pays] == 'Belgique')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/be.gif'></td>";
}
else if ($contenu[pays] == 'Allemagne')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/de.gif'></td>";
}
else if ($contenu[pays] == 'Suisse')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/ch.gif'></td>";
}
else if ($contenu[pays] == 'Espagne')
{
print "<td class='table_light' width='4'><img src='../../_img/_profile/es.gif'></td>";
}
else
{
print "<td class='table_light' width='4'></td>";
}
echo "<td class='table_light' width='123'><a href='index.php?p=joueur_detail&id=$contenu[id]'>".$contenu[pseudo]."</a></td>";
echo "<td class='table_light' width='120'>".$contenu[prenom]."</td>";
//
$sql2 = "SELECT id,nom FROM lao_teams WHERE id = '".$contenu['id_team']."'";
$req2 = mysql_query($sql2) or die ("Erreur Recupération infos".mysql_error());
while($team = mysql_fetch_array ($req2)) {
if ($team[nom] == '') {
echo "<td class='table_light' width='127'>Aucun</td>";
}
else {
echo "<td class='table_light' width='127'>".$team[nom]."</td>";
}
}
//
echo "<td class='table_light' width='97'>1er Janvier 2006</td>";
echo "<td class='table_light' width='47'><a href='mailto:$contenu[email]'><img src='_img/_mini/outlook.gif' width='15' heigh='15' border='0'></a></td>";
echo "<td class='table_light' width='11'><a href='http://$contenu[web]'><img src='_img/_mini/ie.gif' border='0'></a></td>";
echo "<td class='table_light' width='9'></td>";
}
?>
JE vous l'ai donné en entier pour le contexte Voici la ligne qui plante :
//
$sql2 = "SELECT id,nom FROM lao_teams WHERE id = '".$contenu['id_team']."'";
$req2 = mysql_query($sql2) or die ("Erreur Recupération infos".mysql_error());
while($team = mysql_fetch_array ($req2)) {
if ($team[nom] == '') {
echo "<td class='table_light' width='127'>Aucun</td>";
}
else {
echo "<td class='table_light' width='127'>".$team[nom]."</td>";
}
}
//
Lorque j'ai une équipe il me l'affiche bien, seulement lorsque je n'en ai pas, il me supprime ma colonne et décale toutes mes données à gauche.J'ai déja essayé d'afficher "Aucun" si pas de team ou d'utiliser isset ou empty
IMPOSSIBLE...
Si quelqu'un a une idée de pourquoi cela plante
MErci à tous...