何时使用<代码> Zend_Form_Element_Selects with multioptions i在将选定的数值通过Zend_DB_Table
时,即可得出这一错误。
Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column accounts_status in field list
我已经摘录了一些准则,认为这大大有助于说明我的问题。 <
在我的形式上,增加了一些要素和选择(我已经排除了其他要素)
$optionsstatus = array(
active => active ,
pending => pending
);
$optionsrole = array(
guest => guest ,
user => user ,
writer => writer ,
admin => admin
);
$status = new Zend_Form_Element_Select( accounts_status );
$status->setLabel( Status )
->setRequired(true)
->addMultiOptions($optionsstatus);
$role = new Zend_Form_Element_Select( accounts_role );
$role->setLabel( Role )
->setRequired(true)
->addMultiOptions($optionsrole);
我使用Zend_DB_table,插入我的控制者的职位价值。
public function addaccount($username, $fullname, $email,
$password,$status,$roles,$comments)
{
$data = array(
accounts_username => $username,
accounts_fullname => $fullname,
accounts_email => $email,
accounts_password => $password,
accounts_status => $status,
accounts_roles => $roles,
accounts_comments => $comments,
);
$this->insert($data);
}
在我的控制人员中,我拿到职位价值,将其送往我的模式。
$username = $form->getValue( accounts_username );
$fullname = $form->getValue( accounts_fullname );
$email = $form->getValue( accounts_email );
$password = $form->getValue( accounts_password );
$status = $form->getValue( accounts_status );
$roles = $form->getValue( accounts_roles );
$comments = $form->getValue( accounts_comments );
$accounts = new Model_DbTable_Account();
$accounts->addaccount($username, $fullname,$email,
$password,$status,$roles,$comments);
这种做法对我有用,但涉及<代码>的情况除外。 Zend_Form_Element_Select elements. 很想知道,在涉及团结和团结联盟的行动时,是否有具体办法处理这些选定的要素。