0

I want to update a two columns in a row..Please help...

$qb = $this->createQueryBuilder('b')
                   ->update()
                   ->set('b.user1', $user,'b.tempid', $user1)
                   ->where('b.id ='.$id );

this give me the query

UPDATE Shopper\ShopBundle\Entity\Items b SET b.user1 = 1 WHERE b.id =213
4

1 回答 1

0

您可以尝试像这样将 set in 的一个语句分隔为两个

->set('b.user1', $user)
->set('b.tempid', $user1)
于 2013-06-28T07:15:23.950 回答