php - Zend pgsql connection error -
php - Zend pgsql connection error -
i next error while connecting zend , pgsql before programme in mysql working fine
array ( [host] => localhost [username] => openerp [password] => postgresql [dbname] => projects_display [adapter] => pdo_pgsql )
fatal error: uncaught exception 'pdoexception' message 'sqlstate[08006] [7] invalid connection alternative "adapter"' in /var/www/projects/display/display_res/library/zend/db/adapter/pdo/abstract.php:129 stack trace: #0 /var/www/projects/display/display_res/library/zend/db/adapter/pdo/abstract.php(129): pdo->__construct('pgsql:host=loca...', 'openerp', 'postgresql', array) #1 /var/www/projects/display/display_res/library/zend/db/adapter/pdo/pgsql.php(87): zend_db_adapter_pdo_abstract->_connect() #2 /var/www/projects/display/display_res/library/zend/db/adapter/abstract.php(860): zend_db_adapter_pdo_pgsql->_connect() #3 /var/www/projects/display/display_res/library/zend/db/adapter/pdo/pgsql.php(171): zend_db_adapter_abstract->quote('tbl_user_groups') #4 /var/www/projects/display/display_res/library/zend/db/table/abstract.php(835): zend_db_adapter_pdo_pgsql->describetable('tbl_user_groups', null) #5 /var/www/projects/display/display_res/library/zend/db/table/abstract.php(874): zend_db_table_abstract->_setupmetadata() #6 /var in /var/www/projects/display/display_res/library/zend/db/adapter/pdo/abstract.php on l protected function _initdb() { $config = $this->getoptions(); //print_r($config); // db stuff here $parameters =array( 'host' => $config['resources']['db']['params']['host'], 'username' => $config['resources']['db']['params']['username'], 'password' => $config['resources']['db']['params']['password'], 'dbname' => $config['resources']['db']['params']['dbname'], 'adapter' => $config['resources']['db']['adapter'] ); print_r($parameters); echo "<br>"; seek { $db = zend_db::factory($config['resources']['db']['adapter'], $parameters); $db->getconnection(); } grab (zend_db_adapter_exception $e) { } grab (zend_exception $e) { } zend_db_table::setdefaultadapter($db); }
remove $parameters['adapter']
before passing array sec argument zend_db::factory
:
... seek { unset($parameters['adapter']); $db = zend_db::factory($config['resources']['db']['adapter'], $parameters); $db->getconnection(); } ...
php mysql postgresql zend-framework zend-framework2
Comments
Post a Comment