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.
When passing "Complete" make sure it is passed as String. Pass it as $var = "'Complete'"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.