1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php
$connexion=mysql_connect("****", "******", "*****");
if (!$connexion) {
echo "La connexion au serveur a échouée<br>";
exit;
}
if(!mysql_select_db("*****", $connexion)) {
echo "La connexion à la base de données à échouée<br>";
exit;
}
$sql= "select distinct titre, image, nomint, nomdis, anneesortie
from albums, interpretes, distributeurs
where albums.numint=interpretes.numint
and albums.numdis=distributeurs.numdis
order by titre asc";
$interrogation=mysql_query($sql,$connexion);
mysql_close($connexion);
if ($interrogation) {
echo "<table cellpadding='5' cellspacing='45' border='0'>"
."<caption align=up><B><font color=red></font></B></caption>"
."<tr><th></th><th></th></tr>";
while ($ligne=mysql_fetch_array($interrogation))
echo "<tr><td>"."<img src=".$ligne['image']."><td valign=up>"
."<b>"."<u>"."Titre :"." ".$ligne['titre']."</b>"."</u>"."<br>"
."Interprète :"." ".$ligne['nomint']."<br>"
."Année de sortie :"." ".$ligne['anneesortie']."<br>"
."Distributeur :"." ".$ligne['nomdis'];
}
else echo "La base de données ne renvoit aucune réponse";
?> |
Partager