
{filelink=12761}
<html>
<head>
<title>Lignes et Champs</title>
</head>
<body>
<?php
$hote="localhost";
$nom_utilisateur="root";
$mot_de_passe="";
$db = "cours";
$connexion = mysql_connect( $hote, $nom_utilisateur, $mot_de_passe );
if ( ! $connexion )
{
die( "Connexion impossible au serveur: $hote!
avec le nom d'utilisateur: $nom_utilisateur" .mysql_error() );
}
mysql_select_db( $db, $connexion ) or die ( "Impossible d'ouvrir $db: ".mysql_error() );
$resultat = mysql_query( "SELECT * FROM Etudiant where note>10 " );
$nombre_ligne = mysql_num_rows( $resultat );
// Afficher le nombre de résultat retourné
print "<p>La requête a retournée $nombre_ligne Ligne(s) </p><br/>";
print "<table>";
while ( $ligne = mysql_fetch_row( $resultat ) ) {
print "<tr>";
foreach ( $ligne as $field ) {
print "<td>".stripslashes($field)."</td>";
}
print "</tr>";
}
print "</table>";
mysql_close( $connexion );
?>
</body>
</html>