Comment faire ma requête?
Bonsoir j'ai une erreur sur cette requete
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public function botAleatoire()
{
//SELECT *FROM Protection ORDER BY rand( )LIMIT 1
$qb = $this->_em->createQueryBuilder();
$qb->select('p')
->from('KodAnnuaireBundle:Protection','p')
->orderBy('RAND()')
->setMaxResults(1);
return $qb->getQuery()
->getResult();
} |
Code:
1 2
|
[Syntax Error] line 0, col 58: Error: Expected end of string, got '(' |
ma table s'appelle Protection, mon scipt est t'il correcte ?
je vous remercie d'avance pour la réponse :)