Page 1 sur 1

probleme affichage element bdd

Posté : 14 avr. 2006, 12:06
par merde_en_php
j'essai d'afficher des images de ma base de données dans ma page mais ça me met des carrés avec des croix rouge

voila ma syntaxe

<?
$Rs=mysql_query("SELECT * FROM comics");
while($Tab = mysql_fetch_array($Rs)) {
?>
<table width="150" height="230" border="0" cellpadding="1" cellspacing="1">
<tr>
<td width="150" height="230"><img src='<?$Tab["img_co"]; ?>' /></td>
</tr>
</table><?}?>

merci

Posté : 14 avr. 2006, 12:07
par charabia
<?php
$Rs=mysql_query("SELECT * FROM comics");
while($Tab = mysql_fetch_array($Rs))
{
?> 
<table width="150" height="230" border="0" cellpadding="1" cellspacing="1"> 
<tr> 
	<td width="150" height="230"><img src="<?php echo $Tab["img_co"]; ?>" /></td>
</tr> 
</table>
<?php
}
?>
Par contre il faut sortir ton tableau de la boucle...et n'y mettre que ton <tr> ou <td> sinon ton tableau sera dupliqué à chaque fois pour une image...