Image mysql php

Azepo -  
Alain_42 Messages postés 5413 Statut Membre -
Bonjour,
je voudrais faire un tableaux avec des info qui sorte de ma table mysql, comment je fais pour afficher mon image, dans ma table l'image est img en text et c'est un lien.

Mon code :

<!DOCTYPE html>
<html lang="fr">
	<head> 
		<meta charset="utf-8">
		<title>Librydoc</title>
		<link rel="stylesheet" href="css/login.css">
	</head>
<body>				
					<div id="logo">
						<img src="css/images/logo2.png" width="350" height="120" alt="">
					</div>	
 <div id="container">	
<?php
mysql_connect("localhost", "librydoc", "31p71h49"); // Connexion à MySQL
mysql_select_db("librydoc"); // Sélection de la base
 
$reponse = mysql_query("SELECT * FROM notices") or die(mysql_error());

mysql_close(); ?>

<table>
			<thead>
			</tr>
				<th>N°</th>
				<th>Image</th>
				<th>Titre</th>
				<th>Auteur</th>
				<th>Editeur</th>
				<th>Date de parution</th>
			</tr>
			</thead>
<tbody>
<?php
while($donnees = mysql_fetch_array($reponse)) { 
?>

<tr>
<td><?php echo $donnees['id']?></td>
<td><?php echo $donnees['img']?></td>
<td><?php echo $donnees['titre'];?></td>
<td><?php echo $donnees['auteur']?></td>
<td><?php echo $donnees['editeur']?></td>
<td><?php echo $donnees['dtp']?></td>
</tr><?php
}?>

</tbody></table>

 
			</body>
</html>

Merci.
A voir également:

1 réponse

Alain_42 Messages postés 5413 Statut Membre 894
 
Essayes

<tr>
<td><?php echo $donnees['id']?></td>
<td><img alt="" src="<?php echo $donnees['img']?>" /></td>
<td><?php echo $donnees['titre'];?></td>
<td><?php echo $donnees['auteur']?></td>
<td><?php echo $donnees['editeur']?></td>
<td><?php echo $donnees['dtp']?></td>
</tr>


si $donnees['img']=url de l'image
0