setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); self::$conexion -> exec('SET CHARACTER SET utf8'); } catch (PDOException $e) { echo 'Falló la conexión: ' . $e->getMessage(); die(); } } } public static function cerrarConexion(){ if(isset(self::$conexion)){ self::$conexion = null; } } public static function obtenerConexion(){ return self::$conexion; } } ?>