Eléphant du PHP |
256 Messages
05 févr. 2011, 23:08
Si, il y a bien les accolades, j'ai juste repris ce qui est essentiel pour la question !
Il y a pour l'instant un seul record dans la DB et le champ Comment contient "Parti skier !"
Voici le code complet, mais ça complique inutilement
while($row = mysql_fetch_array($result))
{
if ($ListDate <> $row['Date'])
{
if($row['Date']<date("ymd")) Echo "</TR></Tbody></Table><TABLE BORDER='0' CELLSPACING=1 CELLPADDING=2 WIDTH='600' ALIGN='center' BGCOLOR=Silver><Tbody>";
echo "<TR><TD WIDTH='15%'>".substr($row['Date'],-2)."/".substr($row['Date'],2,2)."/20".substr($row['Date'],0,2)."</TD>" ;
$ListDate = $row['Date'];
$ListChoice=" ";
$lead="<TD WIDTH='15%'>";
}
if ($ListChoice <> $row['choice'])
{
$ListChoice = $row['choice'];
$Sep = "";
switch ($ListChoice)
{
case "V":
echo $lead."VTT</TD><TD WIDTH='70%'>";
break;
case "R":
echo $lead."Route</TD><TD WIDTH='70%'>";
break;
case "N":
echo $lead."Ne roule pas</TD><TD WIDTH='70%'>";
break;
case "A":
echo $lead."Absent</TD><TD WIDTH='70%'>";
break;
default:
echo $lead."? ".$ListChoice;
}
$lead="</TD></TR><TR><TD WIDTH='15%'> </TD><TD WIDTH='15%'>";
}
if($row['Comment']=="")
echo $Sep.$row['Name'] ;
else
{
$Comment=$row['Comment'];
echo "<abbr title=".$Comment."><u>".$Sep.$row['Name']."</u></abbr>";
}
$Sep = ", ";
}
Et cet echo donne seulement "Parti".