Exemplo n.º 1
0
 public static function getDBH()
 {
     $ini = parse_ini_file('\\..\\dsn.ini');
     self::$dsn = $ini['server'] . ':dbname=' . $ini['dbname'] . ';host=' . $ini['host'];
     try {
         return new Pdo(self::$dsn, 'root', '');
     } catch (PDOException $e) {
         echo $e->getMessage();
         die;
     }
 }