Insértion des données dans une table

Author:


Download

<html>
<head>
<title>Base de données</title>
</head>
<body>

<?php
   mysql_connect("localhost","root","");
   mysql_select_db("cours");

      $id = "5";
      $nomComp = "Jhon yalley";
      $note= 15;

      $requete = "INSERT INTO Etudiant SET id='$id', nomcomplet='$nomComp', note=$note";

      $result = mysql_query($requete);

      // Afficher un message après l'opération
      if ($result)
         echo "<p>L'etudiant a été inséré!</p>";
      else
         echo "<p>Impossible d'insérer l'étudiant!</p>";

      // Fermer la connexion
      mysql_close();
?>

           </body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


9 + = fourteen