zend 新手问题 - “找不到适配器”
通过 zend 教程进行工作收到此消息,&不知道该去哪里寻找。
谢谢,
An error occurred
Application error
Exception information:
Message: No adapter found for Model_DbTable_Books
Stack trace:
#0 C:\xampp\php\PEAR\Zend\Db\Table\Abstract.php(739): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
#1 C:\xampp\php\PEAR\Zend\Db\Table\Abstract.php(268): Zend_Db_Table_Abstract->_setup()
#2 C:\xampp\htdocs\zftutorials\zftutorial\application\controllers\BooksController.php(34): Zend_Db_Table_Abstract->__construct()
#3 C:\xampp\php\PEAR\Zend\Controller\Action.php(513): BooksController->listAction()
#4 C:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('listAction')
#5 C:\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 C:\xampp\php\PEAR\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
#7 C:\xampp\php\PEAR\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
#8 C:\xampp\htdocs\zftutorials\zftutorial\public\index.php(26): Zend_Application->run()
#9 {main}
Request Parameters:
array (
'controller' => 'books',
'action' => 'list',
'module' => 'default',
)
Working through a zend tutorial & get this message, & not sure where to look.
thanks,
An error occurred
Application error
Exception information:
Message: No adapter found for Model_DbTable_Books
Stack trace:
#0 C:\xampp\php\PEAR\Zend\Db\Table\Abstract.php(739): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
#1 C:\xampp\php\PEAR\Zend\Db\Table\Abstract.php(268): Zend_Db_Table_Abstract->_setup()
#2 C:\xampp\htdocs\zftutorials\zftutorial\application\controllers\BooksController.php(34): Zend_Db_Table_Abstract->__construct()
#3 C:\xampp\php\PEAR\Zend\Controller\Action.php(513): BooksController->listAction()
#4 C:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('listAction')
#5 C:\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 C:\xampp\php\PEAR\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
#7 C:\xampp\php\PEAR\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
#8 C:\xampp\htdocs\zftutorials\zftutorial\public\index.php(26): Zend_Application->run()
#9 {main}
Request Parameters:
array (
'controller' => 'books',
'action' => 'list',
'module' => 'default',
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要连接到数据库,请使用:
并设置默认适配器:
有一些方法可以将特定适配器设置为表,而无需配置默认适配器等...
您可以在文档中查看更多详细信息...请阅读它:D
[] 的
To connect to database use:
And to set a default adapter:
There are some ways to set a specific adapter to a table without configure the default adapter and etc....
You can see more details in documentation... please, read it :D
[]'s
在application文件夹下的bootstrap文件中添加以下代码:
在application.ini文件中添加以下代码:
这是没有配置数据库的问题
Add following code in bootstrap file within the application folder:
and the following code in application.ini file:
this is the problem of not configuration of database
Felipe 是正确的,而教程要求在 application.ini 文件中进行此设置。
Felipe was correct, while the tutorial required this set up in application.ini file.