我尝试使用doctrine orm来使用SELECT。数据库:postgresql
$dql = 'SELECT name_serial FROM serial';
$query = $entityManager->createQuery($dql);
$query->setMaxResults(30);
$result = $query->getResult();
echo json_encode($result);
但有例外:
Uncaught Doctrine\ORM\Query\QueryException: SELECT name_serial FROM serial in /home/{username}/Serials/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:41
有人可以帮忙吗?