Exemplo n.º 1
0
 public function __construct()
 {
     $site_path = realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '../lib/config.ini';
     try {
         $this->db = DatabaseFactory::create($site_path);
         $this->exec = DatabaseFactory::getExecute($site_path);
         $_SESSION['namebd'] = strtoupper($this->db->getAttribute(PDO::ATTR_DRIVER_NAME));
     } catch (PDOException $e) {
         $error = 'Conexion Fallada: ' . $e->getMessage();
         header("Location:index.php?controller=BaseDatos&action=orror&str=" . $error);
     }
 }