dpea85385 2018-10-13 18:55
浏览 34

使用Doctrine的ZendFramework 1.12无法使查询生效。

I am kinda new to ZF1 and Doctorine, and I can't figure out the problem. I inherited an old protect so I am learning as I go with this one.

Here is whats in my model

public function recordResponded($contact_id = 0)
    {
        $this->createQuery()
            ->update()
            ->set($this->_tableAlias . 'responded', '1')
            ->where($this->_tableAlias . '.responded.contact_id', $contact_id)
            ->execute()
        ;
        return true;
    }

Here is what is in my Controller

public function responseAction() {
        header('Content-Type: application/json');
        $this->getHelper('layout')->disableLayout();
        $this->getHelper('viewRenderer')->setNoRender(true);


        $contact_id = $this->getRequest()->getPost('contact_id', null);
        if(empty($contact_id) || !preg_match("/^[0-9]+$/", $contact_id)) {
            echo json_decode(array('message' => 'Failed to record response, numeric id required'));
        }



        Model_ContactTable::getInstance()->recordResponded($contact_id);

        echo json_encode(['status' => 'success']);

    }

and for whatever reason I have no idea currently cause I'm looking around everywhere else and from what I can gather this is the correct way to update a single entry on a row in my DB.

Does anyone else see something I am missing? I just keep getting an error, but its an override, type of error with no stack trace or anything else, which that would be awesome to have to but I can't figure how to turn that on either. Anyway, anything?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探