Get database connection details Magento

Hello Friends

I am writing here an important code snippet for getting the database connection details used in Magento

$config  = Mage::getConfig()->getResourceConnectionConfig("default_setup");
        $_host = $config->host;
        $_uname = $config->username;
        $_pass = $config->password;
        $_dbname = $config->dbname;
        echo $_host; ///likewise

Let me know your comment

0 comments:

Post a Comment