2012-10-30 5 views
1

mysql db에서 행을 업데이트하려고합니다. 나는 몇 가지 문제가 생기고 교리 (1.2 불행히도) dql에서 새로운데, 나는 "세트"부분 때문에 오류가 발생하는 것 같지만 아무데도 할 수있는 확실한 방법을 찾지 못한다. ...DQL 업데이트 세트 (Doctrine 1.2)

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

실행 후 실행 했습니까? – Jeune

답변

2

네, 문제는 세트였습니다. 이 중간에 :

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

+0

내가 과 같은 문제가 있었다'$ Q = Doctrine_Query :() 생성 - (1, 'ns.status') > 설정 - -> 설정 ('NS>을 갱신 ('알림 NS ') 을. seenTime; ','ns.seenTime ', $ 타임 스탬프) - -> ("ns.notificationId = $ notifictionId") > andwhere ("ns.empNum = $ userId를")' 가 를 사용하여이'(설정'? ', $ timestamp)'fixed it –

+0

두 번째 예제의 공식 문서에 설명되어 있습니다 : http://docs.doctrine-project.org/projects/doctrine1/en/latest/en/manual/dql-doctrine-query-language .html # update-queries – Epoc

관련 문제