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
| $select = " SELECT livre.*,auteur.* FROM livre,auteur where livre.name = '".$ok."' " ;
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
echo $select ;
echo $total ;
$row = mysql_fetch_array($result) ; //Retourne une ligne de résultat MySQL sous la forme d'un tableau associatif
echo $row;
$histoire = $row['histoire'] ;
$photo = $row['photo'] ;
// print '<img src="'$photo'" alt="" width="100" height="100"/><br />';
// si on a récupéré un résultat on l'affiche.
if($total) {
// début du tableau
echo '<table bgcolor="#FFFFFF">'."\n";
// première ligne on affiche les titres prénom et surnom dans 2 colonnes
echo '<tr>';
echo '<td bgcolor="#669999"><b><u>livre</u></b></td>';
echo '<td bgcolor="#669999"><b><u>date</u></b></td>';
echo '<td bgcolor="#669999"><b><u>édition</u></b></td>';
echo '</tr>'."\n";
// lecture et affichage des résultats sur 2 colonnes, 1 résultat par ligne.
while($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$row['nom'].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row['dateparution'].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row['édition'].'</td>';
echo '</tr>'."\n";
}
echo '</table>'."\n" ;
// fin du tableau.
} |
Partager