English 中文(简体)
我如何绕过Zentd_Form_Element_ 选择性的 d错误?
原标题:How do I go around this Zend_Form_Element_Select db error?

何时使用<代码> Zend_Form_Element_Selects with multioptions i在将选定的数值通过Zend_DB_Table时,即可得出这一错误。

Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column  accounts_status   in  field list 

我已经摘录了一些准则,认为这大大有助于说明我的问题。 <accounts_status field DOES 我的表格已经存在。

在我的形式上,增加了一些要素和选择(我已经排除了其他要素)

    $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. 很想知道,在涉及团结和团结联盟的行动时,是否有具体办法处理这些选定的要素。

最佳回答
Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column  accounts_status   in  field list 

Maybe I m crazy, 但我想到,到这里, account_status field name就有了额外的空间。

问题回答

暂无回答




相关问题
Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

Tagging with Zend Framework

I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...

dynamicaly adding textboxes to zend_form

I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...

热门标签