Menu
Hi All
I’m using doctrine, and at some point it throws an DoctrineORMNoResultException exception.
So I tried to catch it like
[CODE]
try {
$qb = $em->createQueryBuilder();
$qb->add(‘select’, ‘u.name’)
->add(‘select’, ‘u.passwd’)
->add(‘from’, ‘EntitiesUser u’)
->add(‘where’, ‘u.name = ?1’)
->setParameter(1,$_POST[‘usern’]);
$q = $qb->getQuery();
$result = $q->execute();
} catch (DoctrineORMNoResultException $e) {
echo “{login: false}” ;
return ;
}
Whatever I try I can’t catch the exception. I read somewhere that you should add
[CODE]
use DoctrineORM ;
but that didn’t fix it
Any suggestions ?
thnx
Luca