My query doesn´t take data when i try to introduce in the query the addcslashes
I am working with symfony 4 in local witn xampp php 7.3.3
public function findByValue($value)
{
$value = '%'.addcslashes($value, '%_').'%';
return $this->createQueryBuilder('u')
->orWhere('u.name = :val')
->orWhere('u.surname = :val')
->orWhere('u.email = :val')
->setParameter('val', $value)
->getQuery()
->getResult();
}
the query works ok whithout the addcslashes but it doesn´t make what i want.
public function findByValue($value)
{
$value = '%'.addcslashes($value, '%_').'%';
return $this->createQueryBuilder('u')
->orWhere('u.name like :val1')
->orWhere('u.surname like :val2')
->orWhere('u.email like :val3')
->setParameter('val1', $value)
->setParameter('val2', $value)
->setParameter('val3', $value)
->getQuery()
->getResult();
}