Advertisement
Guest User

Untitled

a guest
May 30th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. $user = "root"; // A adapté
  3. $pass = "toor"; // A adapté
  4. try {
  5.     $dbh = new PDO('mysql:host=localhost;dbname=gestioncle', $user, $pass);
  6.     $sth = $dbh->prepare("SELECT Id_portes FROM Portes WHERE Batiment = 'Bat A'");
  7.     $sth->execute();
  8.     $result = $sth->fetchAll();
  9.     print_r($result);
  10. } catch (PDOException $e) {
  11.     print "Erreur : " . $e->getMessage() . "<br/>";
  12.     die();
  13. }
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement