Reputation: 3843
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.
Upvotes: 0
Views: 6586
Reputation: 5391
When passing "Complete" make sure it is passed as String. Pass it as $var = "'Complete'"
Upvotes: 1