par
Snipy » 02 janv. 2008, 23:50
Voila c'est pas très beau ce que j'ai fait mais ça a le mérite de marcher...
while ($row = mysql_fetch_assoc($resultat))
{
$timestamp_match = strtotime($row['date_prevue']);
if($timestamp_match < time())
{
if($k == 0)
{
echo '<div class="corps-sp1">
<h2>Archivés </h2>';
}
echo '<p>
<span style="color:rgb(100,100,100);">'.$row['date_prevue'].'</span>
<a href="voir_match.php?id_match='.$row['id_match'].'">'.$row['equipe_dom'].' '.$row['buts_dom'].' - ' .$row['buts_ext'].' '.$row['equipe_ext'].'</a>
</p>';
if($k == 0)
{
echo'</div>';
}
}
else
{
if($g == 0)
{
echo '<div class="corps-sp1">
<h2>A venir </h2>';
}
echo '<p>
<span style="color:rgb(100,100,100);">'.$row['date_prevue'].'</span> <a href="voir_match.php?id_match='.$row['id_match'].'">'.$row['equipe_dom'].' '.$row['buts_dom'].' - ' .$row['buts_ext'].' '.$row['equipe_ext'].'</a> <a href = "feuille_match.php?id_match='.$row['id_match'].'" style="color:#710101";>Ordre du match </a>
</p>';
if($k == 0)
{
echo '</div>';
}
}
$k=1;
}
par contre je ne comprend pas pourquoi je suis obliger de changer le nom à la 3ème petite condition ( $g) et pourquoi un $k =1 à la fin de la boucle est superflue?
Voila c'est pas très beau ce que j'ai fait mais ça a le mérite de marcher...
[php]while ($row = mysql_fetch_assoc($resultat))
{
$timestamp_match = strtotime($row['date_prevue']);
if($timestamp_match < time())
{
if($k == 0)
{
echo '<div class="corps-sp1">
<h2>Archivés </h2>';
}
echo '<p>
<span style="color:rgb(100,100,100);">'.$row['date_prevue'].'</span>
<a href="voir_match.php?id_match='.$row['id_match'].'">'.$row['equipe_dom'].' '.$row['buts_dom'].' - ' .$row['buts_ext'].' '.$row['equipe_ext'].'</a>
</p>';
if($k == 0)
{
echo'</div>';
}
}
else
{
if($g == 0)
{
echo '<div class="corps-sp1">
<h2>A venir </h2>';
}
echo '<p>
<span style="color:rgb(100,100,100);">'.$row['date_prevue'].'</span> <a href="voir_match.php?id_match='.$row['id_match'].'">'.$row['equipe_dom'].' '.$row['buts_dom'].' - ' .$row['buts_ext'].' '.$row['equipe_ext'].'</a> <a href = "feuille_match.php?id_match='.$row['id_match'].'" style="color:#710101";>Ordre du match </a>
</p>';
if($k == 0)
{
echo '</div>';
}
}
$k=1;
}[/php]
par contre je ne comprend pas pourquoi je suis obliger de changer le nom à la 3ème petite condition ( $g) et pourquoi un $k =1 à la fin de la boucle est superflue?