par
graffx » 11 déc. 2011, 19:54
salut la compagnie!!
bien, je vous explique brievement mais tout est dans le titre, j' aimerai afficher des articles en faisant un select sur 2 colonnes.
Voici ce que j' ai fait, mais il y a un souci et je n' arrive pas a trouver mon erreur. Du coup dans la deuxieme colonnes la moitié des choses ne sont pas affichées, juste le titre, pas la photo.
Si je deplace mon accolade, tout part en vrille tant au niveau de l 'affichage et je me retrouve en plus avec des photos en double.
Merci d'avance pour les yeux de lynx!
<table width="1000">
<tr>
<td width="500" height="103" align="center" valign="top" background="images/bg_art.png" style="background-repeat:no-repeat;"><table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><ul>
<?php
$i=0;
$return = mysql_query('SELECT * FROM articles ORDER BY id DESC');
$nb = ceil(mysql_num_rows($return )/2);
while ($data = mysql_fetch_array($return))
{
if ($i++ == $nb) { ?>
<a href="art.php?id=<?php echo $data['id'];?>"></a>
<br />
</ul></td>
</tr>
<tr>
<td width="25%" height="93" align="left" valign="top"><img src="images/articles/<?php echo $data['photo'];?>" width="50" height="60" /></td>
<td width="75%"> </td>
</tr>
</table></td><td width="500" align="left" valign="top" background="images/bg_art.png" style="background-repeat:no-repeat;"><table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><ul>
<?php }
?>
<li><a href="art.php?id=<?php echo $data['id'];?>"><?php echo $data['titre'];?></a></li>
<?php
}
?>
<br />
</ul></td>
</tr>
<tr>
<td width="34%" align="left" valign="top"><img src="images/articles/<?php echo $data['photo'];?>" alt="" width="50" height="60" /></td>
<td width="66%"> </td>
</tr>
</table></td>
</tr>
</table>