我正在尝试进行分页,但是有一个错误:
$dql = "SELECT cast(ip as CHAR) as ip FROM histories";
$query = $em->createQuery($dql)->setFirstResult($offset)->setMaxResults($limit);
$paginator = new Paginator($query);
$maxpage = ceil($paginator->count() / $limit);
错误
[语法错误]第0行,第7行:错误:预期的IdentificationVariable | ScalarExpression | AggregateExpression |功能声明| PartialObjectExpression | “(”Subselect“)”| CaseExpression,获得'*'
$ maxpage = ceil($ paginator-> count()/ $ limit); //错误行