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 35 36 37 38 39 40 41 42
| <?php
mysql_connect("localhost","root","");
mysql_select_db("base");
$sql =
<<<'SQL'
SELECT
c.nom AS categ,
d.nom_doc AS doc,
cd.annee,
cd.prix
FROM categ_doc cd
INNER JOIN categorie c ON cd.idCat = c.idCategorie
INNER JOIN document d ON cd.idDoc = d.idDocument
ORDER BY
d.doc_nom ASC,
cd.annee DESC
SQL;
$qry = mysql_query($sql);
?>
<table id="tableHTML" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse; border-color:#111111" width="50%">
<thead>
<tr>
<th>Catégorie</th>
<th>Document</th>
<th>Année</th>
<th>Prix</th>
</tr>
</thead>
<tbody>
<?php while($row = mysql_fetch_assoc($qry)): ?>
<tr>
<td width="10%" align="center"><?php echo $row['categ'] ?></td>
<td><?php echo $row['doc'] ?></td>
<td><?php echo $row['annee'] ?></td>
<td><?php echo $row['prix'] ?> </td>
</tr>
<?php endwhile ?>
</tbody>
</table> |
Partager