遇到问题

时间:2014-02-12 19:42:19

标签: php mysql socialengine

我的表单有问题。由于某种原因,它没有填充我命名为关于

的表格

表格信息(关于): 用户身份, aboutme_id, 约,

表格信息(用户): 用户身份, ... ... ... 等

形式:

 $this->addElement('textarea', 'description', array(
      'label' => 'Body Content',
      'required' => true,
      'allowEmpty' => false,
    ));

验证

public function onProcess()
  {
    // In this case, the step was placed before the account step.
    // Register a hook to this method for onUserCreateAfter
    if( !$this->_registry->user ) {
      // Register temporary hook
      Engine_Hooks_Dispatcher::getInstance()->addEvent('onUserCreateAfter', array(
        'callback' => array($this, 'onProcess'),
      ));
      return;
    }
    $user = $this->_registry->user;

    $data = $this->getSession()->data;
    $form = $this->getForm();
    if( !$this->_skip && !$this->getSession()->skip ) {
      if( $form->isValid($data) ) {
        $values = $form->getValues();
        $table = Engine_Api::_()->getDbtable('about', 'user');
            $rName = $table->info('name');
                $userTable = Engine_Api::_()->getDbtable('users', 'user')->info('name');
                $select = $select
        ->setIntegrityCheck(false)
        ->from($userTable)
        ->joinLeft($userTable, "$userTable.user_id = $rName.user_id")
        ->where($userTable, "$userTable.user_id = $rName.user_id");

      }
    }
  }

知道这张照片发生了什么事吗?

1 个答案:

答案 0 :(得分:0)

尝试使用echo "<pre>"; print_r(); echo "</pre>"; die();在某个控制器的示例空操作中测试数据库表操作以调试结果。您还可以使用$select->__toString()来获取构造查询的原始sql。

另请查看/temporary/log/main.log以获取一些通知/错误。