Doctrine query builder match username and password Please check the below code of the snippet:- $query = $em->createQuery("SELECT u FROM App\Entity\FrontUser u WHERE u.email = :email AND u.password = :password")->setParameter('email', $_REQUEST['username'])->setParameter('password', md5($_REQUEST['password'])); $users = $query->getResult(); Doctrine query builder match username