Je voulais pour un souci de mise en page afficher un <hr /> tous les trois enregistrements.
J'ai fait ça :
<?php
$result = mysql_query("SELECT type_id, label, pos, description FROM ld_type ORDER BY pos ASC");
$i = 1;
while($data = mysql_fetch_assoc($result))
{
$label_t = $data["label"];
$id_t = $data["type_id"];
$url_t = rewriteURL($label_t)."-collection-".$id_t.".html";
//$desc_t = substr($data["description"],0,70)."...";
$desc_t = $data["description"];
$res = mysql_query("SELECT image FROM ld_collection where type_id = ".$id_t." ORDER BY collection_id DESC LIMIT 1");
while($dt = mysql_fetch_assoc($res)){ $image_t = $dt["image"];}
?>
<div class="bloc_categories"> <a href="<?php echo $url_t?>" title="<?php echo $label_t?>"><img src="../images/<?php echo $image_t?>" alt="<?php echo $label_t?>" width="55" height="55" /></a>
<h3><?php echo $label_t?></h3>
<p><?php echo $desc_t?></p>
<p class="contact_catalogue"><a href="<?php echo $url_t?>"><?php echo $label_t?></a></p>
</div>
<?php
if ((($i / 3)==1) && ($i!=1)){
echo "<hr />";
}
}
?>
Mais ça ne marche pas, pas de <hr /> tous les trois enregistrements, et je n'ai pas de message d'erreur pour m'aider.Si quelqu'un voit le problème,
Merci pour votre aide