I love VIC |
Bonjour,
Voici mon code :
<?php
$query = "SELECT name, title FROM articleuh ORDER BY Rand() LIMIT 1";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$name = nl2br($row[name]);
$title = nl2br($row[name]);
echo "<table width='88' border='0' cellspacing='0' cellpadding='0'><tr><td width='88' height='88'>";
echo "<a href='show-video.php?id=$name'><img src='img/biereflat.jpg' width='88' height='88' border='0'></a></td></tr><tr>";
echo "<td><div align='center'><span class='noir'>$title</span></div></td></tr></table>";}
?>
J'ai mis plusieurs fois ce code dans ma page. Malheureusement, il affiche parfois plusieurs fois la meme et j'aimerais éviter cela.
Comment procéder ? Connaissez vous une astuce ?
Merci d'avance. -- Je vous aiderai dans la mesure du possible ;) |
Admin |
Salut,
<?php
$query = "SELECT name, title FROM articleuh ORDER BY Rand() LIMIT 3";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result))
{
$name = nl2br($row[0]);
$title = nl2br($row[1]);
echo '<table><tr><td>
<a href="show-video.php?id=',$name,'"><img src="img/biereflat.jpg" alt="" /></a></td></tr><tr>
<td class="noir">',$title,'</td></tr></table>';
}
?>
inutile de mettre 36 fois la requête, ça ne fait qu'alourdir le processus. -- |