probleme affichage element bdd

merde_en_php
Invité n'ayant pas de compte PHPfrance

14 avr. 2006, 12:06

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

Avatar du membre
ViPHP
ViPHP | 3008 Messages

14 avr. 2006, 12:07

<?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...