try { $dbh = new PDO('pgdb'); $dbs1 = $dbh->query('SELECT * from Commune'); ... } catch (PDOException $e) { print "Erreur !: " . $e->getMessage() . "<br/>"; die(); }