Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

where in no result in doctrine query builder

hey i have problem with where in in doctrine and i search and query is exactly like this but it result always is empty. where in not works . what is the problem?

$qb = $this->connection->getQueryBuilder();
        $users = ['admin'];
        $result = $qb->select("*")
            ->from("users")
            ->where("groles IN (:groles)")
            ->setParameter('groles', $users)
            ->execute()
            ->fetchAll();

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try with

use Doctrine\DBAL\Connection;

//....

->setParameter('groles', $users, Connection::PARAM_STR_ARRAY)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading