Thursday 15 March 2012

php - zend framwork database connection not working -


I'm trying to make a database connection in the Zend Framework

Below is my application.ini < / p>

  [production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = " Bootstrap "appnamespace =" application "resources.frontController.controllerDirectory = APPLICATION_PATH" / controller "resources.frontController.params.displayExceptions = 1 database.adapter = pdo_mysql database.params.host = localhost database.params.username = root database.params .password = database.params.dbname = test resources.db.isDefaultTableAdapter = F [staging: production] [trial production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development: production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resource .frontController.params.displayExceptions = 1  < / pre> 

get the error

  message: Application_Model_DbTable_User No adapters found stack trace: # 0 D: \ xampp \ php \ pear \ Zend \ Db \ Table \ Abstract.php (739): Zend_Db_Table_Abstract-> _setupDatabaseAdapter () # 1D: \ XAMPP \ php \ Pears \ Zend \ Db \ Table \ Abstract.php (268): Zend_Db_Table_Abstract- & gt; _setup () # 2D: \ XAMPP \ htdocs \ test \ application \ controllers \ IndexController.php (14): Zend_Db_Table_Abstract- & gt; __ Construction () # 3d: \ XAMPP \ php \ Pears \ Zend \ Controller \ Action.php (516): IndexController-> IndexAction () # 4D: \ XAMPP \ php \ Pears \ Zend \ Controller \ Dispatcher \ Standard.php (295): Zend_Controller_Action-> Remittance ('indexAction') # 5D: \ XAMPP \ Php \ pear \ Zend \ Controller \ Front.php (9 54): Zend_Controller_Dispatcher_Standard- & gt; Dispatch (Object (Zend_Controller_Request_Http), objects (Zend_Controller_Response_Http)) # 6 D: \ xampp \ php \ pear \ Zend \ Application \ Bootstrap \ Bootstrap Php (97): Zend_Controller_Front- & gt; Sending () # 7D: \ xampp \ php \ pear \ zend \ application.php (366): Zend_Applicat Ion_Bootstrap_bootstrap- & gt; Play () # 8D: \ xampp \ htdocs \ test \ public \ index.php (26): Zend_Application- & gt; Run () # 9 {main} Request parameter: Array ('Controller' = & gt; 'index', 'action' => gt; 'index', 'module' = & gt;  

< / P>

I think you need to add "resource" and the value has been put between "".

  resources.db.adapter = "pdo_mysql" Resources.db.params.host = "localhost" resources.db.params.port = 3306 resources.db.params.username = "root" resources. db.params.password = "" resources.db.params.dbname = "Test" resources.db.isDefaultTableAdapter = true   

and < Pre>

Hope this helps. < / Div>

No comments:

Post a Comment