Mautic Community Forums

Get company with "&" in name

Hi,

I am trying to get a specific company which has an ampersand in its name. The reqeust is being sent with mautic api-library to the companies endpoint with a custom query which looks something like this:

$qb = new QueryBuilder();
$qb->setSelect(“SELECT * FROM companies”);
$qb->addWhere($qb->expr()->eq(‘companyname’, “MY COMPANY & NAME”));

This works as intended as long as there is no ampsersand in the company name. The URL for the query gets encoded like this but does not return any matches even though it should:

select=SELECT+%2A+FROM+companies&where%5B0%5D%5Bcol%5D=companyname&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=MY+COMPANY+%26+NAME&limit=1000000000000000000

Is there any way to find a company with “&” in its name?