Reputation:
i'm trying to use
$db = Zend_Db_Table::getDefaultAdapter();
But it returns NULL
I tried to add
resources.db.isDefaultTableAdapter = true
in my application.ini but no changes at all...
thanks in advance for your help
Upvotes: 1
Views: 944
Reputation: 855
Try to add this
SetEnv APPLICATION_ENV development
in the end of file PROJECTNAME\public\.htaccess
Upvotes: 0
Reputation: 101
You should add the following function into Bootstrap
protected function _initDatabase() {
$db = $this->getPluginResource('db')->getDbAdapter();
Zend_Db_Table::setDefaultAdapter($db); //important
Zend_Registry::set('db', $db);
}
Upvotes: 2