static function getBDD() { if (self::$bdd == null) { include_once "params.inc.php"; try { self::$bdd = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $user, $password); } catch (PDOException $e) { print "Erreur !: " . $e->getMessage() . "<br/>"; die; } } return self::$bdd; }
public function __construct() { $this->bdd = SingletonBD::getBDD(); }