【问题标题】:DQL Update Set ( Doctrine 1.2 )DQL 更新集(Doctrine 1.2)
【发布时间】:2012-10-30 12:22:20
【问题描述】:

我正在尝试更新 mysql 数据库中的一行。我遇到了一些问题,而且我是教义新手(不幸的是 1.2)dql,我想我因为“集合”部分而遇到错误,但我在任何地方都找不到正确的方法......

    $q = Doctrine_Query::create()
        ->update('OfferUser')
        ->set('price_alone', $price_alone)
        ->set('price_group', $price_group)
        ->set('comments', $comments)
        ->where('id=?', $id);

【问题讨论】:

    标签: set dql doctrine-1.2


    【解决方案1】:

    是的,问题出在布景上……我必须输入 '?'中间是这样的:

    set('price_group', '?', $price_group)

    【讨论】:

    • 我遇到了与$q = Doctrine_Query::create() ->update('Notification ns') ->set('ns.status',1) ->set('ns.seenTime',$timestamp) ->where("ns.notificationId = $notifictionId") ->andwhere("ns.empNum = $userId"); 相同的问题,使用set('ns.seenTime','?',$timestamp) 修复了它
    • 在官方文档中描述的第二个例子:docs.doctrine-project.org/projects/doctrine1/en/latest/en/…
    猜你喜欢
    • 1970-01-01
    • 2015-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多