Symfony2: update query with query builder
- by Ichigo Kurosaki
This is my query
$id contains primary key and $status contains new status
public function updateStatus($id,$status)
{
$qb=$this-createQueryBuilder('b')
-update()
-set('b.status',$status)
-where('b.id='.$id);
echo $qb;
return $qb-getQuery()
-getResult();
}
Problem I am facing is
[Semantical Error] line 0, col 56 near 'Complete WHERE': Error: 'Complete' is not defined.