<?php
try {
    $dbh = new PDO('mysql:host=localhost;dbname=mediateur', "root","");
    $statement=$dbh->prepare('SELECT * from etablissement');
    $statement->execute();
    $array = $statement->fetchAll(PDO::FETCH_ASSOC);

    echo json_encode($array);
    
    $dbh = null;
} catch (PDOException $e) {
    print "Erreur !: " . $e->getMessage() . "<br/>";
    die();
}


?>