Hello, I get the error:

T0.id AS id1, t0.name AS name2, t0.description AS description3 FROM Group t0 '

SQLSTATE [42000]: Syntax error or access violation: 1064 SQL syntax; If you’re on the right line, you’ll be able to get around.

I work with Symfony 2.8, Doctrine 2.

The error appears when I declare the $ repGroup variable;

$repGroup = $this->getDoctrine()->getRepository('AppBundle:Group'); $group = $repGroup->findAll(); 

Here is a description of my class (already generated, but shown without links and setters and getters):

  /** * @ORM\Entity * @ORM\Table(name="Group") */ class Group { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\Column(type="string", length=100, nullable=false) */ private $name; /** * @ORM\Column(type="text", length=255, nullable=true) */ private $description; 

Thank!

    1 answer 1

    The name of the Group table is the sql keyword, so it cannot be used without escaping. Therefore, it is necessary to either screen or change the name of the table.