Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.38 KB | None | 0 0
  1. <?php
  2. /*
  3.  * Auteur : Damien Loïc
  4.  * Date : 04/04/2011
  5.  *
  6.  */
  7.  
  8.  
  9. function connectDb()
  10. {
  11.     $server = '127.0.0.1';
  12.     $username = 'root';
  13.     $password = '';
  14.     $dbname = 'test2';
  15.    
  16.     $connexion = mysql_connect( $server, $username, $password )
  17.       or die("Could not connect to server: " . mysql_error());
  18.     mysql_select_db($dbname, $connexion)
  19.       or die("Invalid select database: " . mysql_error());
  20.      return $connexion;
  21. }
  22.  
  23.  
  24. function addCLient($nom, $prenom, $nomSociete, $titre, $noTelephone, $adresseEail, $rue, $codePostal, $ville, $idGenre, $idPays)
  25. {
  26.     $connexion = connectDb();
  27.     mysql_query("INSERT INTO tCLient (nom, prenom, nomSociete, titre, noTelephone, adresseEmail rue, codePostal, vill, idGenre, idPays) VALUES ('$nom', '$prenom', '$nomSociete', '$titre', '$noTelephone', '$adresseEail', '$rue', '$codePostal', '$ville', $idGenre, $idPays)", $connexion);
  28.     mysql_close($connexion);   
  29. }
  30.  
  31. function modCLient($idCLient, $nom, $prenom, $nomSociete, $titre, $noTelephone, $adresseEail, $rue, $codePostal, $ville, $idGenre, $idPays)
  32. {
  33.     $connexion = connectDb();
  34.     mysql_query("UPDATE tCLient SET nom='$nom', prenom='$prenom', nomSociete='$nomSociete', titre='$titre', noTelephone='$noTelephone', adresseEmail='$adresseEail', rue='$rue', codePostal='$codePostal', ville='$ville', idGenre='$idGenre', idPays='$idPays' WHERE idCLient=$idCLient", $connexion);
  35.     mysql_close($connexion);   
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement