I'm trying to execute an SQL request to get all future events.
So far, it looks like this :
$dql = "SELECT a FROM AOFVHFlyBundle:Flight a WHERE precisedate >= NOW()";
$query = $em->createQuery($dql);
But I get the following error:
line 0, col 59: Error: Expected known function, got 'NOW'
How can i get all my future flights ?
The DQL Function you are looking for is the
CURRENT_TIMESTAMP()
. As described in the doc.