Advertisement
Guest User

Untitled

a guest
May 31st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2. $user = "root"; // A adapté
  3. $pass = "pass"; // 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.     $finalRes = Array('Id_portes' => $row["Id_portes"]);
  10.     print_r($finalRes);
  11. } catch (PDOException $e) {
  12.     print "Erreur : " . $e->getMessage() . "<br/>";
  13.     die();
  14. }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement