Has*_*P A 10 php mysql symfony
我无法在symfony2存储库中使用DATEDIFF和CURRENT_TIME.当我使用年份函数时,同样的问题就在那里.为什么会发生这种情况?
return $this->getEntityManager()
->createQuery("SELECT u FROM AcmeAdminBundle:AppUsers u WHERE DATEDIFF(CURRENT_TIME(), u.dob) BETWEEN :fromage AND :toage and u.country = :countries ORDER BY u.id DESC")
->setParameter('fromage', $fromage)
->setParameter('toage', $toage)
->setParameter('countries', $countrystr);
Run Code Online (Sandbox Code Playgroud)
如果我没有使用上述功能,此查询正常工作
| 归档时间: |
|
| 查看次数: |
7877 次 |
| 最近记录: |