在zend框架中获得异常

时间:2011-08-06 10:10:18

标签: zend-framework zend-db-table

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();

}

1 个答案:

答案 0 :(得分:0)

该异常显示您在第116行从Zend_Db_Table_Abstract->fetchRow('abc')调用ClmsRegistrationModel.php。这是where子句设置为'abc'的位置。