在 zend 框架中获取异常
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'abc' in 'where clause'' in C:\xampp\htdocs\CLMS\library\Zend\Db\Statement\Pdo.php:234 Stack trace: #0 C:\xampp\htdocs\CLMS\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1 C:\xampp\htdocs\CLMS\library\Zend\Db\Adapter\Abstract.php(468): Zend_Db_Statement->execute(Array) #2 C:\xampp\htdocs\CLMS\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select), Array) #3 C:\xampp\htdocs\CLMS\library\Zend\Db\Table\Abstract.php(1509): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Table_Select)) #4 C:\xampp\htdocs\CLMS\library\Zend\Db\Table\Abstract.php(1371): Zend_Db_Table_Abstract->_fetch(Object(Zend_Db_Table_Select)) #5 C:\xampp\htdocs\CLMS\application\models\ClmsRegistrationModel.php(116): Zend_Db_Table_Abstract->fetchRow('abc') #6 C:\xampp\htdocs\CLMS\application\modules\default\controllers\AuthController.php(65): clms in C:\xampp\htdocs\CLMS\library\Zend\Db\Statement\Pdo.php on line 234
这个异常是什么? 以及如何解决。
public static function setRole($emp_id,$role)
{
//$select = $this->select();
$row = $this->fetchRow('employee_id=?',$emp_id);
$row->role_organization=$role;
$row->save();
}
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'abc' in 'where clause'' in C:\xampp\htdocs\CLMS\library\Zend\Db\Statement\Pdo.php:234 Stack trace: #0 C:\xampp\htdocs\CLMS\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1 C:\xampp\htdocs\CLMS\library\Zend\Db\Adapter\Abstract.php(468): Zend_Db_Statement->execute(Array) #2 C:\xampp\htdocs\CLMS\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select), Array) #3 C:\xampp\htdocs\CLMS\library\Zend\Db\Table\Abstract.php(1509): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Table_Select)) #4 C:\xampp\htdocs\CLMS\library\Zend\Db\Table\Abstract.php(1371): Zend_Db_Table_Abstract->_fetch(Object(Zend_Db_Table_Select)) #5 C:\xampp\htdocs\CLMS\application\models\ClmsRegistrationModel.php(116): Zend_Db_Table_Abstract->fetchRow('abc') #6 C:\xampp\htdocs\CLMS\application\modules\default\controllers\AuthController.php(65): clms in C:\xampp\htdocs\CLMS\library\Zend\Db\Statement\Pdo.php on line 234
What is this exception?
and how it can be solved.
public static function setRole($emp_id,$role)
{
//$select = $this->select();
$row = $this->fetchRow('employee_id=?',$emp_id);
$row->role_organization=$role;
$row->save();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该异常表明您正在从第 116 行的
ClmsRegistrationModel.php
调用Zend_Db_Table_Abstract->fetchRow('abc')
。这就是 where 子句设置为 ' abc'。The exception shows that you are calling
Zend_Db_Table_Abstract->fetchRow('abc')
fromClmsRegistrationModel.php
on line 116. That is where the where clause is getting set to 'abc'.