I am developing a web application in symfony. I want to fetch the records from database according to months. My Query is:
$totalSearchesByAdminAll = $em->createQueryBuilder()
->select('count(SearchHistory.id) AS totalSearchesByAdmin')
->from('DRPAdminBundle:Log', 'SearchHistory')
->where('SearchHistory.last_updated like :last_updated')
->setParameter('last_updated',??????.'%')
->andwhere('SearchHistory.event = :event')
->setParameter('event','ADMIN_SEARCH')
->getQuery()
->getArrayResult();
last_updated is datetime field and stores in database like: 2015-06-12 11:50:44
I want records like Jan=>5 Feb=>10 .....and so on..
Please Help