Symfony Doctrine update query fail
问题 My code is: $query = $em->createQuery("UPDATE AppBundle:Project u SET u.name=1, u.key=?2, u.leader=?3 WHERE u.id = ?4"); $query->setParameter(1, $project->name); $query->setParameter(2, $project->key); $query->setParameter(3, $project->lead->name); $query->setParameter(4, $project->id); $result = $query->getResult(); Now when I run it, it gives me a error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your