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
// appel du script de connexion
include("connect.php");
// écriture de la requête d'extraction en SQL
$sql = "SELECT utilCom, comUtilisateur FROM Commentaires
WHERE etatCom='oui'";
// envoi de la requête
$result=mysql_query($sql,$connexion);
$nbLigne =mysql_num_rows($result);
$nbColone =mysql_num_fields($result);
echo("<table border=1 width=100%>");
echo("<tr>");
echo("<th>Nom d'utilisateur</th>");
echo("<th>Commentaire</th>");
echo("</tr>");
for($i=0; $i<$nbLigne ;$i++)
{
echo"<tr>";
for($j=0; $j<$nbColone; $j++)
{
echo"<td>";
echo mysql_result($result, $i, $j)." ";
echo"</td>";
}
echo "</tr>";
}
echo"</table>";
mysql_close($connexion);
?>
<br> <a href="accueil.htm">retour a l'accueil</a> |
Partager