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

}

MPelletier
  • 16,256
  • 15
  • 86
  • 137
  • Could you post the statement you are trying to execute? It looks like you are referencing a non-existing column in a where clause. – Pelshoff Aug 06 '11 at 10:25
  • public static function setRole($emp_id,$role) { //$select = $this->select(); $row = $this->fetchRow('employee_id=?',$emp_id); $row->role_organization=$role; $row->save(); } –  Aug 06 '11 at 11:12
  • Side note: Referencing `$this` in a static method probably warrants some reconsideration. – David Weinraub Aug 06 '11 at 13:20

1 Answers1

0

The exception shows that you are calling Zend_Db_Table_Abstract->fetchRow('abc') from ClmsRegistrationModel.php on line 116. That is where the where clause is getting set to 'abc'.

H Hatfield
  • 881
  • 5
  • 9