I am trying to run a replace query, like this:
$qb = $this->createQueryBuilder('q');
$qb->where("REPLACE(q.name,'-','') = :q")->setParameter('q', $q);
return $qb->getQuery()->execute();
This will work fine.
The problem is I try to replace a single quote "REPLACE(q.name,'\'','') = :q"
It will complain it cannot escape it.
same with "REPLACE(q.name,'\\'','') = :q" or "REPLACE(q.name,\"'\",'') = :q"
Any ideas?